mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 00:02:14 -04:00
Add tests
This commit is contained in:
parent
7d51480c4d
commit
ddbfb44041
2 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue