diff options
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/mock/loader.py | 8 | ||||
| -rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_interface.py | 2 | ||||
| -rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_ping.py | 2 | ||||
| -rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_static_route.py | 2 | ||||
| -rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_user.py | 2 | 
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py index c21188ee..aea5df56 100644 --- a/tests/unit/mock/loader.py +++ b/tests/unit/mock/loader.py @@ -46,12 +46,12 @@ class DictDataLoader(DataLoader):      # TODO: the real _get_file_contents returns a bytestring, so we actually convert the      #       unicode/text it's created with to utf-8 -    def _get_file_contents(self, path): -        path = to_text(path) +    def _get_file_contents(self, file_name): +        path = to_text(file_name)          if path in self._file_mapping: -            return (to_bytes(self._file_mapping[path]), False) +            return (to_bytes(self._file_mapping[file_name]), False)          else: -            raise AnsibleParserError("file not found: %s" % path) +            raise AnsibleParserError("file not found: %s" % file_name)      def path_exists(self, path):          path = to_text(path) diff --git a/tests/unit/modules/network/vyos/test_vyos_interface.py b/tests/unit/modules/network/vyos/test_vyos_interface.py index 1194e3bd..e0e4bfc7 100644 --- a/tests/unit/modules/network/vyos/test_vyos_interface.py +++ b/tests/unit/modules/network/vyos/test_vyos_interface.py @@ -86,7 +86,7 @@ class TestVyosInterfaceModule(TestVyosModule):          self.mock_execute_lldp_command.stop()          self.mock_execute_interfaces_command.stop() -    def load_fixtures(self, commands=None, transport="cli"): +    def load_fixtures(self, commands=None, transport="cli", filename=None):          self.get_config.return_value = load_fixture(              "vyos_interface_config.cfg"          ) diff --git a/tests/unit/modules/network/vyos/test_vyos_ping.py b/tests/unit/modules/network/vyos/test_vyos_ping.py index f3ba2ee5..60407ad6 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ping.py +++ b/tests/unit/modules/network/vyos/test_vyos_ping.py @@ -49,7 +49,7 @@ class TestVyosPingModule(TestVyosModule):              output = list()              for command in commands: -                filename = str(command).split(" | ")[0].replace(" ", "_") +                filename = str(command).split(" | ", 1)[0].replace(" ", "_")                  output.append(load_fixture("vyos_ping_%s" % filename))              return output diff --git a/tests/unit/modules/network/vyos/test_vyos_static_route.py b/tests/unit/modules/network/vyos/test_vyos_static_route.py index 21f11394..00985c6a 100644 --- a/tests/unit/modules/network/vyos/test_vyos_static_route.py +++ b/tests/unit/modules/network/vyos/test_vyos_static_route.py @@ -52,7 +52,7 @@ class TestVyosStaticRouteModule(TestVyosModule):          self.mock_get_config.stop()          self.mock_load_config.stop() -    def load_fixtures(self, commands=None, transport="cli"): +    def load_fixtures(self, commands=None, transport="cli", filename=None):          self.get_config.return_value = ""          self.load_config.return_value = dict(diff=None, session="session") diff --git a/tests/unit/modules/network/vyos/test_vyos_user.py b/tests/unit/modules/network/vyos/test_vyos_user.py index d4c2dbe6..616ad095 100644 --- a/tests/unit/modules/network/vyos/test_vyos_user.py +++ b/tests/unit/modules/network/vyos/test_vyos_user.py @@ -50,7 +50,7 @@ class TestVyosUserModule(TestVyosModule):          self.mock_get_config.stop()          self.mock_load_config.stop() -    def load_fixtures(self, commands=None, transport="cli"): +    def load_fixtures(self, commands=None, transport="cli", filename=None):          self.get_config.return_value = load_fixture("vyos_user_config.cfg")          self.load_config.return_value = dict(diff=None, session="session")  | 
