diff --git a/Makefile b/Makefile index dcfe46c..4a6ed9e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ifeq (${PYTHON}, ) override PYTHON=3.6 endif -DOCKER=docker run -p 8888:8888 -v ${PWD}:/ntc_rosetta ntc_rosetta-${PYTHON}:latest +DOCKER=docker run -it --rm -p 8888:8888 -v ${PWD}:/ntc_rosetta ntc_rosetta-${PYTHON}:latest YANG_VENDORED_BASE_PATH=ntc_rosetta/yang diff --git a/pyproject.toml b/pyproject.toml index fd870cb..b1fd255 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ yangify = "^0.1.1" [tool.poetry.dev-dependencies] pytest = "^4.2" -black = { version = "19.3b0", allows-prereleases = true } +black = { version = "19.3b0", allow-prereleases = true } pylama = "^7.6" flake8-import-order = "^0.18.0" mypy = "^0.701.0" diff --git a/tests/models/ntc/__init__.py b/tests/models/ntc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/__init__.py b/tests/models/ntc/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/__init__.py b/tests/models/ntc/data/ntc_vlan/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/merge/__init__.py b/tests/models/ntc/data/ntc_vlan/merge/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/merge/ios/__init__.py b/tests/models/ntc/data/ntc_vlan/merge/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/__init__.py b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/data_candidate.json b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/data_candidate.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/data_candidate.json rename to tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/data_candidate.json diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/data_running.json b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/data_running.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/data_running.json rename to tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/data_running.json diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/res_merge b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/res_merge similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/res_merge rename to tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/res_merge diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/res_replace b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/res_replace similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/add_vlans/res_replace rename to tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/res_replace diff --git a/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/test_case.py b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/ntc/data/ntc_vlan/merge/ios/add_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/__init__.py b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/data_candidate.json b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/data_candidate.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/data_candidate.json rename to tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/data_candidate.json diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/data_running.json b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/data_running.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/data_running.json rename to tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/data_running.json diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/res_merge b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/res_merge similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/res_merge rename to tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/res_merge diff --git a/tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/res_replace b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/res_replace similarity index 100% rename from tests/models/ntc/data/ntc-vlan/merge/ios/remove_vlans/res_replace rename to tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/res_replace diff --git a/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/test_case.py b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/ntc/data/ntc_vlan/merge/ios/remove_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/ntc/data/ntc_vlan/parse/__init__.py b/tests/models/ntc/data/ntc_vlan/parse/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/parse/ios/__init__.py b/tests/models/ntc/data/ntc_vlan/parse/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/parse/ios/config/__init__.py b/tests/models/ntc/data/ntc_vlan/parse/ios/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc-vlan/parse/ios/config/dev_conf b/tests/models/ntc/data/ntc_vlan/parse/ios/config/dev_conf similarity index 100% rename from tests/models/ntc/data/ntc-vlan/parse/ios/config/dev_conf rename to tests/models/ntc/data/ntc_vlan/parse/ios/config/dev_conf diff --git a/tests/models/ntc/data/ntc-vlan/parse/ios/config/result.json b/tests/models/ntc/data/ntc_vlan/parse/ios/config/result.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/parse/ios/config/result.json rename to tests/models/ntc/data/ntc_vlan/parse/ios/config/result.json diff --git a/tests/models/ntc/data/ntc_vlan/parse/ios/config/test_case.py b/tests/models/ntc/data/ntc_vlan/parse/ios/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/ntc/data/ntc_vlan/parse/ios/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/ntc/data/ntc_vlan/translate/__init__.py b/tests/models/ntc/data/ntc_vlan/translate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/translate/ios/__init__.py b/tests/models/ntc/data/ntc_vlan/translate/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/__init__.py b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/data.json b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/data.json similarity index 100% rename from tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/data.json rename to tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/data.json diff --git a/tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/res_merge b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/res_merge similarity index 100% rename from tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/res_merge rename to tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/res_merge diff --git a/tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/res_replace b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/res_replace similarity index 100% rename from tests/models/ntc/data/ntc-vlan/translate/ios/test_case_1/res_replace rename to tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/res_replace diff --git a/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/test_case.py b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/ntc/data/ntc_vlan/translate/ios/test_case_1/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/__init__.py b/tests/models/openconfig/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/__init__.py b/tests/models/openconfig/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/description_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/description_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/mtu_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/mtu_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_list_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_list_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_change/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_change/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/subinterfaces_member_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/subinterfaces_member_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/ios/switchport_conf_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/ios/switchport_conf_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/description_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/description_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_list_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_list_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_change/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_change/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/subinterfaces_member_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/subinterfaces_member_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_add/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_add/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/data_candidate.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/data_candidate.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/data_running.json b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/data_running.json rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/data_running.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/res_merge b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/res_replace b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/merge/junos/switchport_conf_remove/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/merge/junos/switchport_conf_remove/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/parse/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/ios/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/parse/ios/config/dev_conf b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/dev_conf similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/parse/ios/config/dev_conf rename to tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/dev_conf diff --git a/tests/models/openconfig/data/openconfig-interfaces/parse/ios/config/result.json b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/result.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/parse/ios/config/result.json rename to tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/result.json diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/parse/ios/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/junos/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/parse/junos/config/dev_conf b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/dev_conf similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/parse/junos/config/dev_conf rename to tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/dev_conf diff --git a/tests/models/openconfig/data/openconfig-interfaces/parse/junos/config/result.json b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/result.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/parse/junos/config/result.json rename to tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/result.json diff --git a/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/parse/junos/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/ios/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/data.json b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/data.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/data.json rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/data.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/res_merge b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/res_replace b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_1/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_1/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/data.json b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/data.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/data.json rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/data.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/res_merge b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/res_replace b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/ios/test_case_2/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/translate/ios/test_case_2/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/junos/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/__init__.py b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/data.json b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/data.json similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/data.json rename to tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/data.json diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/res_merge b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/res_merge rename to tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/res_merge diff --git a/tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/res_replace b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-interfaces/translate/junos/test_case_1/res_replace rename to tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/res_replace diff --git a/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/test_case.py b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_interfaces/translate/junos/test_case_1/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/__init__.py b/tests/models/openconfig/data/openconfig_system/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/merge/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_dns_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/add_dns_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ntp_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ntp_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_ssh_user/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/add_ssh_user/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/add_tacacs_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/add_tacacs_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_dns_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_dns_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ntp_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ntp_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_ssh_user/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_ssh_user/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/__init__.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/data_candidate.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/data_candidate.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/data_running.json b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/data_running.json rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/data_running.json diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/res_merge b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/res_merge rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/res_replace b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/merge/junos/remove_tacacs_server/res_replace rename to tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/test_case.py b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/merge/junos/remove_tacacs_server/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_system/parse/__init__.py b/tests/models/openconfig/data/openconfig_system/parse/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/parse/junos/__init__.py b/tests/models/openconfig/data/openconfig_system/parse/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/parse/junos/config/__init__.py b/tests/models/openconfig/data/openconfig_system/parse/junos/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/parse/junos/config/dev_conf b/tests/models/openconfig/data/openconfig_system/parse/junos/config/dev_conf similarity index 100% rename from tests/models/openconfig/data/openconfig-system/parse/junos/config/dev_conf rename to tests/models/openconfig/data/openconfig_system/parse/junos/config/dev_conf diff --git a/tests/models/openconfig/data/openconfig-system/parse/junos/config/result.json b/tests/models/openconfig/data/openconfig_system/parse/junos/config/result.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/parse/junos/config/result.json rename to tests/models/openconfig/data/openconfig_system/parse/junos/config/result.json diff --git a/tests/models/openconfig/data/openconfig_system/parse/junos/config/test_case.py b/tests/models/openconfig/data/openconfig_system/parse/junos/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/parse/junos/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/openconfig/data/openconfig_system/translate/__init__.py b/tests/models/openconfig/data/openconfig_system/translate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/translate/junos/__init__.py b/tests/models/openconfig/data/openconfig_system/translate/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/__init__.py b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/data.json b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/data.json similarity index 100% rename from tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/data.json rename to tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/data.json diff --git a/tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/res_merge b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/res_merge rename to tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/res_merge diff --git a/tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/res_replace b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-system/translate/junos/test_case_1/res_replace rename to tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/res_replace diff --git a/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/test_case.py b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_system/translate/junos/test_case_1/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_vlan/__init__.py b/tests/models/openconfig/data/openconfig_vlan/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/ios/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/data_candidate.json b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/data_candidate.json rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/data_running.json b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/data_running.json rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/data_running.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/res_merge b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/res_merge rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/res_merge diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/res_replace b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/add_vlans/res_replace rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/res_replace diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/test_case.py b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/merge/ios/add_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/data_candidate.json b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/data_candidate.json rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/data_running.json b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/data_running.json rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/data_running.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/res_merge b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/res_merge rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/res_merge diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/res_replace b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/ios/remove_vlans/res_replace rename to tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/res_replace diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/test_case.py b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/merge/ios/remove_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/junos/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/data_candidate.json b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/data_candidate.json rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/data_running.json b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/data_running.json rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/data_running.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/res_merge b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/res_merge rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/res_merge diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/res_replace b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/add_vlans/res_replace rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/res_replace diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/test_case.py b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/merge/junos/add_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/__init__.py b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/data_candidate.json b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/data_candidate.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/data_candidate.json rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/data_candidate.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/data_running.json b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/data_running.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/data_running.json rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/data_running.json diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/res_merge b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/res_merge rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/res_merge diff --git a/tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/res_replace b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/merge/junos/remove_vlans/res_replace rename to tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/res_replace diff --git a/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/test_case.py b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/test_case.py new file mode 100644 index 0000000..e759188 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/merge/junos/remove_vlans/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, merge + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_merge(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + merge(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/__init__.py b/tests/models/openconfig/data/openconfig_vlan/parse/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/ios/__init__.py b/tests/models/openconfig/data/openconfig_vlan/parse/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/__init__.py b/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/parse/ios/config/dev_conf b/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/dev_conf similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/parse/ios/config/dev_conf rename to tests/models/openconfig/data/openconfig_vlan/parse/ios/config/dev_conf diff --git a/tests/models/openconfig/data/openconfig-vlan/parse/ios/config/result.json b/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/result.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/parse/ios/config/result.json rename to tests/models/openconfig/data/openconfig_vlan/parse/ios/config/result.json diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/test_case.py b/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/parse/ios/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/junos/__init__.py b/tests/models/openconfig/data/openconfig_vlan/parse/junos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/__init__.py b/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/parse/junos/config/dev_conf b/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/dev_conf similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/parse/junos/config/dev_conf rename to tests/models/openconfig/data/openconfig_vlan/parse/junos/config/dev_conf diff --git a/tests/models/openconfig/data/openconfig-vlan/parse/junos/config/result.json b/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/result.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/parse/junos/config/result.json rename to tests/models/openconfig/data/openconfig_vlan/parse/junos/config/result.json diff --git a/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/test_case.py b/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/test_case.py new file mode 100644 index 0000000..33cb979 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/parse/junos/config/test_case.py @@ -0,0 +1,7 @@ +from tests.models.test_models import parse_path, parser + + +def test_parser() -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + parser(test_data.org, test_data.model, test_data.driver, test_data.path) diff --git a/tests/models/openconfig/data/openconfig_vlan/translate/__init__.py b/tests/models/openconfig/data/openconfig_vlan/translate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/translate/ios/__init__.py b/tests/models/openconfig/data/openconfig_vlan/translate/ios/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/__init__.py b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/data.json b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/data.json similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/data.json rename to tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/data.json diff --git a/tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/res_merge b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/res_merge similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/res_merge rename to tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/res_merge diff --git a/tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/res_replace b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/res_replace similarity index 100% rename from tests/models/openconfig/data/openconfig-vlan/translate/ios/test_case_1/res_replace rename to tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/res_replace diff --git a/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/test_case.py b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/test_case.py new file mode 100644 index 0000000..331e9a8 --- /dev/null +++ b/tests/models/openconfig/data/openconfig_vlan/translate/ios/test_case_1/test_case.py @@ -0,0 +1,10 @@ +from tests.models.test_models import parse_path, translate + +import pytest + + +@pytest.mark.parametrize("action", ["merge", "replace"]) # type: ignore +def test_translate(action: str) -> None: + """Run a merge test with the provided action.""" + test_data = parse_path(__file__) + translate(test_data.org, test_data.driver, test_data.path, action) diff --git a/tests/models/test_models.py b/tests/models/test_models.py index b9b93bf..5ba263c 100644 --- a/tests/models/test_models.py +++ b/tests/models/test_models.py @@ -1,11 +1,19 @@ import json import pathlib -from typing import Any, Dict, List, Tuple +from typing import Dict, List, NamedTuple import ntc_rosetta -import pytest - +Data = NamedTuple( + "Data", + [ + ("org", str), + ("model", str), + ("driver", str), + ("action", str), + ("path", pathlib.Path), + ], +) filters: Dict[str, Dict[str, List[str]]] = { "ntc-vlan": {"include": [], "exclude": []}, @@ -67,98 +75,107 @@ } -def get_test_cases(test: str) -> Dict[str, Any]: - base = pathlib.Path(__file__).parent - - test_cases: List[Tuple[str, str, str, pathlib.Path]] = [] - ids: List[str] = [] - for model_path in base.iterdir(): - org = model_path.name - if not model_path.is_dir() or model_path.name == "__pycache__": - continue - for data_path in model_path.joinpath(f"data").iterdir(): - model = data_path.name - for driver_path in sorted(data_path.joinpath(test).iterdir()): - driver = driver_path.name - for test_case_path in sorted(driver_path.iterdir()): - test_case = test_case_path.name - ids.append(f"{model}_{driver}_{test_case}") - test_cases.append((org, model, driver, test_case_path)) - return { - "argnames": "org,model,driver,test_case_path", - "argvalues": test_cases, - "ids": ids, - } - - -class Test: - @pytest.mark.parametrize(**get_test_cases("parse")) # type: ignore - def test_parser( - self, org: str, model: str, driver: str, test_case_path: pathlib.Path - ) -> None: - with open(test_case_path.joinpath("dev_conf"), "r") as f: - dev_conf = f.read() - with open(test_case_path.joinpath("result.json"), "r") as f: - structured = json.load(f) - - driver_class = ntc_rosetta.get_driver(driver, org) - device = driver_class() - - parsed_obj = device.parse( - native={"dev_conf": dev_conf}, - validate=False, - include=filters[model]["include"], - exclude=filters[model]["exclude"], - ) - # print(json.dumps(parsed_obj.raw_value())) - assert parsed_obj.raw_value() == structured, json.dumps(parsed_obj.raw_value()) - - def _test_translate( - self, org: str, driver: str, test_case_path: pathlib.Path, mode: str - ) -> None: - with open(test_case_path.joinpath("data.json"), "r") as f: - candidate = json.load(f) - with open(test_case_path.joinpath(f"res_{mode}"), "r") as f: - expected = f.read() - driver_class = ntc_rosetta.get_driver(driver, org) - device = driver_class() - config = device.translate(candidate, replace=mode == "replace") - assert config == expected - - @pytest.mark.parametrize(**get_test_cases("translate")) # type: ignore - def test_translate_merge( - self, org: str, model: str, driver: str, test_case_path: pathlib.Path - ) -> None: - self._test_translate(org, driver, test_case_path, "merge") - - @pytest.mark.parametrize(**get_test_cases("translate")) # type: ignore - def test_translate_replace( - self, org: str, model: str, driver: str, test_case_path: pathlib.Path - ) -> None: - self._test_translate(org, driver, test_case_path, "replace") - - def _test_merge( - self, org: str, driver: str, test_case_path: pathlib.Path, mode: str - ) -> None: - with open(test_case_path.joinpath("data_candidate.json"), "r") as f: - candidate = json.load(f) - with open(test_case_path.joinpath("data_running.json"), "r") as f: - running = json.load(f) - with open(test_case_path.joinpath(f"res_{mode}"), "r") as f: - expected = f.read() - driver_class = ntc_rosetta.get_driver(driver, org) - device = driver_class() - res_merge = device.merge(candidate, running, replace=mode == "replace") - assert res_merge == expected - - @pytest.mark.parametrize(**get_test_cases("merge")) # type: ignore - def test_merge_merge( - self, org: str, model: str, driver: str, test_case_path: pathlib.Path - ) -> None: - self._test_merge(org, driver, test_case_path, "merge") - - @pytest.mark.parametrize(**get_test_cases("merge")) # type: ignore - def test_merge_replace( - self, org: str, model: str, driver: str, test_case_path: pathlib.Path - ) -> None: - self._test_merge(org, driver, test_case_path, "replace") +def parser(org: str, model: str, driver: str, test_case_path: pathlib.Path) -> None: + """Run parser test on models with given data. + + The files + - `dev_conf` + - `result.json` + **must** be present in the test case path. + + Args: + org: YANG organization + model: YANG model to parse + driver: ntc-rosetta driver + test_case_path: parsed __file__ attribute of caller + + """ + with open(test_case_path.joinpath("dev_conf"), "r") as f: + dev_conf = f.read() + with open(test_case_path.joinpath("result.json"), "r") as f: + structured = json.load(f) + + driver_class = ntc_rosetta.get_driver(driver, org) + device = driver_class() + + parsed_obj = device.parse( + native={"dev_conf": dev_conf}, + validate=False, + include=filters[model.replace("_", "-")]["include"], + exclude=filters[model.replace("_", "-")]["exclude"], + ) + # print(json.dumps(parsed_obj.raw_value())) + assert parsed_obj.raw_value() == structured, json.dumps(parsed_obj.raw_value()) + + +def translate(org: str, driver: str, test_case_path: pathlib.Path, mode: str) -> None: + """Run merge test on models with given data. + + The files + - `data.json` + - `data_running.json` + - `res_{{ mode }}` + **must** be present in the test case path. + + Args: + org: YANG organization + driver: ntc-rosetta driver + test_case_path: parsed __file__ attribute of caller + mode: options of {"replace", "merge"} + + """ + with open(test_case_path.joinpath("data.json"), "r") as f: + candidate = json.load(f) + with open(test_case_path.joinpath(f"res_{mode}"), "r") as f: + expected = f.read() + driver_class = ntc_rosetta.get_driver(driver, org) + device = driver_class() + config = device.translate(candidate, replace=mode == "replace") + assert config == expected + + +def parse_path(pathname: str) -> Data: + """Parse a given test path into a useful object + + Args: + pathname: string, path must conform to + `tests/models/{org}/data/{model}/{action}/{driver}` + + Returns: + A namedtuple of strings + + """ + path = pathlib.Path(pathname) + action = path.parents[2].stem + driver = path.parents[1].stem + model = path.parents[3].stem.replace("_", "-") + org = path.parents[5].stem + return Data(org, model, driver, action, path.parent) + + +def merge(org: str, driver: str, test_case_path: pathlib.Path, mode: str) -> None: + """Run merge test on models with given data. + + The files + - `data_candidate.json` + - `data_running.json` + - `res_{{ mode }}` + **must** be present in the test case path. + + Args: + org: YANG organization + driver: ntc-rosetta driver + test_case_path: parsed __file__ attribute of caller + mode: options of {"replace", "merge"} + + """ + with open(test_case_path.joinpath("data_candidate.json"), "r") as f: + candidate = json.load(f) + with open(test_case_path.joinpath("data_running.json"), "r") as f: + running = json.load(f) + with open(test_case_path.joinpath(f"res_{mode}"), "r") as f: + expected = f.read() + driver_class = ntc_rosetta.get_driver(driver, org) + device = driver_class() + res_merge = device.merge(candidate, running, replace=mode == "replace") + assert res_merge == expected