mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
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:
parent
1d0a629dcc
commit
7c1b8da1a1
2 changed files with 36 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue