Commit c42a0c69 by fwkz

Adding assertIsSubset helper function

parent 4a680098
...@@ -20,6 +20,9 @@ class RoutersploitTestCase(unittest.TestCase): ...@@ -20,6 +20,9 @@ class RoutersploitTestCase(unittest.TestCase):
msg="'{}' method should be decorated with 'module_required'".format(function.__name__) msg="'{}' method should be decorated with 'module_required'".format(function.__name__)
) )
def assertIsSubset(self, subset, container):
[self.assertIn(element, container) for element in subset]
def assertIsSequence(self, arg): def assertIsSequence(self, arg):
self.assertEqual( self.assertEqual(
True, True,
......
...@@ -31,7 +31,7 @@ class ModuleTest(RoutersploitTestCase): ...@@ -31,7 +31,7 @@ class ModuleTest(RoutersploitTestCase):
"authors", "authors",
"references" "references"
) )
self.assertItemsEqual(required_metadata, self.module_metadata.keys()) self.assertIsSubset(required_metadata, self.module_metadata.keys())
def test_metadata_type(self): def test_metadata_type(self):
self.assertIsSequence(self.module_metadata['authors']) self.assertIsSequence(self.module_metadata['authors'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment