From a4916a82ac6f676c512fa43481d77fdb7e95ce1b Mon Sep 17 00:00:00 2001 From: Jakub Krajewski Date: Thu, 7 Mar 2024 20:35:46 +0100 Subject: [PATCH] Add integration test for fast check if transformation works --- .../test_config_migration.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 catalystwan/integration_tests/test_config_migration.py diff --git a/catalystwan/integration_tests/test_config_migration.py b/catalystwan/integration_tests/test_config_migration.py new file mode 100644 index 00000000..4deac363 --- /dev/null +++ b/catalystwan/integration_tests/test_config_migration.py @@ -0,0 +1,28 @@ +import os +import unittest +from typing import cast + +from catalystwan.session import create_manager_session +from catalystwan.workflows.config_migration import collect_ux1_config, transform + + +class TestConfigMigration(unittest.TestCase): + def setUp(self) -> None: + self.session = create_manager_session( + url=cast(str, os.environ.get("TEST_VMANAGE_URL")), + port=cast(int, int(os.environ.get("TEST_VMANAGE_PORT"))), # type: ignore + username=cast(str, os.environ.get("TEST_VMANAGE_USERNAME")), + password=cast(str, os.environ.get("TEST_VMANAGE_PASSWORD")), + ) + + def test_config_migration(self): + ux1_config = collect_ux1_config(self.session) + ux2_config = transform(ux1_config) + # push_ux2_config(self.session, ux2_config) + # This section will include the Feature profiles creation + # and pushing the configuration to the vManage + assert ux2_config + + def tearDown(self) -> None: + # This section will include the Feature profiles deletion + self.session.close()