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_main_no_rules_hit(self):
# Python file that doesn't hit any rules should exit successfully.
fp = NamedTemporaryFile(suffix=".py", delete=False)
fp.close()
with self.assertRaises(SystemExit) as ex:
sys.argv = [sys.argv[0], fp.name]
main()
os.remove(fp.name)
sys.argv = [sys.argv[0]]
self.assertEqual(ex.exception.code, 0)
def __init__(self, methodName):
super(VerminExclusionsTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminGeneralTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminConstantMemberTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminArgumentsTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminLaxModeTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminFunctionMemberTests, self).__init__(methodName)
self.config = Config.get()
def __init__(self, methodName):
super(VerminClassMemberTests, self).__init__(methodName)
self.config = Config.get()
def test_detect_hidden_paths(self):
tmp_fld = mkdtemp()
files = [touch(tmp_fld, ".test.py"), touch(tmp_fld, "test.py"), touch(tmp_fld, ".test2.py"),
touch(tmp_fld, "test2.py")]
paths = detect_paths([tmp_fld], hidden=False)
without_dot = [files[1], files[3]]
self.assertEqualItems(without_dot, paths)
paths2 = detect_paths([tmp_fld], hidden=True)
self.assertEqualItems(files, paths2)
rmtree(tmp_fld)
def test_detect_vermin_min_versions(self):
paths = detect_paths([abspath("vermin")])
processor = Processor()
(mins, incomp, unique_versions, backports) = processor.process(paths)
self.assertOnlyIn(((2, 7), (3, 0)), mins)
self.assertEmpty(backports)