1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-24 19:22:07 +03:00

Add tests

This commit is contained in:
Joona Hoikkala
2016-01-14 00:50:34 +02:00
parent 7d51480c4d
commit ddbfb44041
2 changed files with 8 additions and 1 deletions

View File

@@ -185,7 +185,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
"/test//*[self::arg=~regexp('argument', 'i')]")
except RuntimeError:
self.aug.remove("/test/path")
return None
return False
self.aug.remove("/test/path")
return matches

View File

@@ -978,6 +978,13 @@ class TwoVhost80Test(util.ApacheTest):
self.assertTrue(self.config.parser.find_dir(
"NameVirtualHost", "*:443", exclude=False))
def test_aug_version(self):
mock_match = mock.Mock(return_value=["something"])
self.config.aug.match = mock_match
self.assertEquals(self.config._check_aug_version(), ["something"])
self.config.aug.match.side_effect = RuntimeError
self.assertFalse(self.config._check_aug_version())
if __name__ == "__main__":
unittest.main() # pragma: no cover