Refactor openvswitch unit tests (#24055)

Rather than passing a file to load fixture, build a matrix containing
the run_command side_effect per test.
This will allow more code-reuse for other ovs modules unit tests.
This commit is contained in:
Ricardo Carrillo Cruz 2017-04-27 14:48:37 +02:00 committed by GitHub
commit 7c1b8da1a1
2 changed files with 36 additions and 12 deletions

View file

@ -65,9 +65,9 @@ class AnsibleFailJson(Exception):
class TestOpenVSwitchModule(unittest.TestCase):
def execute_module(self, failed=False, changed=False,
command=None, fixture_name=None):
command=None, test_name=None):
self.load_fixtures(fixture_name)
self.load_fixtures(test_name)
if failed:
result = self.failed()
@ -108,5 +108,5 @@ class TestOpenVSwitchModule(unittest.TestCase):
self.assertEqual(result['changed'], changed, result)
return result
def load_fixtures(self, fixture_name):
def load_fixtures(self, test_name):
pass