Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_modules(self):
self.assertEqualItems((
"argparse",
"configparser",
"enum",
"faulthandler",
"typing",
), Backports.modules())
def test_backport(self):
# Needs part.
self.assertContainsDict({"code": 1}, parse_args(["--backport"]))
self.assertEmpty(self.config.backports())
# Unknown module.
self.assertContainsDict({"code": 1}, parse_args(["--backport", "foobarbaz"]))
self.assertEmpty(self.config.backports())
# Known modules.
for mod in Backports.modules():
self.config.reset()
self.assertContainsDict({"code": 0}, parse_args(["--backport", mod]))
self.assertEqualItems([mod], self.config.backports())
def test_is_backport(self):
for mod in Backports.modules():
self.assertTrue(Backports.is_backport(mod))