diff options
author | GomathiselviS <gomathiselvi@gmail.com> | 2021-08-26 14:09:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 18:09:25 +0000 |
commit | 66c9b207fc95406b237c3b808466fc2c324a6731 (patch) | |
tree | 6e208aa9a8cccdb57a951d33d4afcfb21d885c2c /tests | |
parent | 01273758372bfd62c470d9edb3c177fdae87ad9f (diff) | |
download | vyos-ansible-collection-66c9b207fc95406b237c3b808466fc2c324a6731.tar.gz vyos-ansible-collection-66c9b207fc95406b237c3b808466fc2c324a6731.zip |
Fix pylint sanity issues (#204)
Fix pylint sanity issues
Signed-off-by: GomathiselviS gomathiselvi@gmail.com
SUMMARY
ISSUE TYPE
Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: None <None>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sanity/ignore-2.12.txt | 2 | ||||
-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 |
6 files changed, 9 insertions, 9 deletions
diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index d753480..496cf86 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -9,4 +9,4 @@ plugins/module_utils/network/vyos/config/prefix_lists/prefix_lists.py import-2.6 plugins/module_utils/network/vyos/config/prefix_lists/prefix_lists.py compile-2.6!skip plugins/modules/vyos_logging_global.py import-2.6!skip plugins/module_utils/network/vyos/config/logging_global/logging_global.py import-2.6!skip -plugins/module_utils/network/vyos/config/logging_global/logging_global.py compile-2.6!skip
\ No newline at end of file +plugins/module_utils/network/vyos/config/logging_global/logging_global.py compile-2.6!skip diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py index c21188e..aea5df5 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 1194e3b..e0e4bfc 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 f3ba2ee..60407ad 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 21f1139..00985c6 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 d4c2dbe..616ad09 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") |