From b2dd05465b80e666c957ebc857b875f8681699e8 Mon Sep 17 00:00:00 2001 From: Vinay M <63404819+roverflow@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:05:19 +0530 Subject: Fix prefix-lists Integration tests (#338) * Fix prefix-lists Integration tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove autoversion * fix galaxy.yml * sanity fix * sanity ignore * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix ignore file --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 1 - changelogs/fragments/integration_test_fix.yml | 3 +++ tests/integration/targets/vyos_prefix_lists/tests/cli/deleted.yaml | 1 + tests/sanity/ignore-2.17.txt | 1 + tests/unit/mock/loader.py | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/integration_test_fix.yml create mode 100644 tests/sanity/ignore-2.17.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32c6311..a9ef17e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,6 @@ repos: - repo: https://github.com/ansible-network/collection_prep rev: 1.1.1 hooks: - - id: autoversion - id: update-docs - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/changelogs/fragments/integration_test_fix.yml b/changelogs/fragments/integration_test_fix.yml new file mode 100644 index 0000000..d792424 --- /dev/null +++ b/changelogs/fragments/integration_test_fix.yml @@ -0,0 +1,3 @@ +--- +trivial: + - vyos_prefix_lists - fix vyos_prefix_lists in integration tests to resolve issues related to deletion. diff --git a/tests/integration/targets/vyos_prefix_lists/tests/cli/deleted.yaml b/tests/integration/targets/vyos_prefix_lists/tests/cli/deleted.yaml index 9209fad..efcb14c 100644 --- a/tests/integration/targets/vyos_prefix_lists/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_prefix_lists/tests/cli/deleted.yaml @@ -9,6 +9,7 @@ - block: # Delete all prefix-lists - name: Delete all prefix-lists + ignore_errors: true register: result vyos.vyos.vyos_prefix_lists: &id006 config: diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt new file mode 100644 index 0000000..c835eef --- /dev/null +++ b/tests/sanity/ignore-2.17.txt @@ -0,0 +1 @@ +plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py index 258dccd..2828f38 100644 --- a/tests/unit/mock/loader.py +++ b/tests/unit/mock/loader.py @@ -30,7 +30,7 @@ from ansible.parsing.dataloader import DataLoader class DictDataLoader(DataLoader): def __init__(self, file_mapping=None): file_mapping = {} if file_mapping is None else file_mapping - assert type(file_mapping) == dict + assert isinstance(file_mapping, dict) super(DictDataLoader, self).__init__() -- cgit v1.2.3