aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-03-26 12:56:41 +0100
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2024-03-26 15:08:58 +0100
commit7801bc09e09b7816c7690f14bc18afd013c5e70a (patch)
tree43e4b556e68747734e545a33d0949cd65e456cce /tests
parent4a99e7286857a83a9e2c557263363228f410bac8 (diff)
Fix SDC v2 distribution status - desird status
If DOWNLOAD_OK check not for all components Issue-ID: TEST-404 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: I4111ceb8b3aeb69023d8c80a80b6ef57c95b9575
Diffstat (limited to 'tests')
-rw-r--r--tests/test_sdc2_service.py16
-rw-r--r--tests/test_settings.py3
-rw-r--r--tests/test_version.py2
3 files changed, 17 insertions, 4 deletions
diff --git a/tests/test_sdc2_service.py b/tests/test_sdc2_service.py
index 23fab64..5be7b6d 100644
--- a/tests/test_sdc2_service.py
+++ b/tests/test_sdc2_service.py
@@ -546,9 +546,21 @@ def test_service_distribution_distribution_components_test(mock_distribution_sta
ServiceDistribution.DistributionStatus(
component_id=component_id,
timestamp=str(randint(0, maxsize)),
+ status=str(uuid4()),
+ url=str(uuid4()),
+ error_reason="null"
+ ) for component_id in list(
+ settings.SDC_SERVICE_DISTRIBUTION_DESIRED_STATE.keys())
+ ]
+ assert sd._distribution_components_test is False
+
+ mock_distribution_status_list.return_value = [
+ ServiceDistribution.DistributionStatus(
+ component_id=component_id,
+ timestamp=str(randint(0, maxsize)),
status="DOWNLOAD_OK",
url=str(uuid4()),
- error_reason=str(uuid4())
+ error_reason="null"
) for component_id in settings.SDC_SERVICE_DISTRIBUTION_COMPONENTS
]
assert sd._distribution_components_test is True
@@ -559,7 +571,7 @@ def test_service_distribution_distribution_components_test(mock_distribution_sta
timestamp=str(randint(0, maxsize)),
status="DOWNLOAD_OK",
url=str(uuid4()),
- error_reason=str(uuid4())
+ error_reason="null"
) for component_id in settings.SDC_SERVICE_DISTRIBUTION_COMPONENTS + ["additional-test-component"]
]
assert sd._distribution_components_test is True
diff --git a/tests/test_settings.py b/tests/test_settings.py
index 154eed0..96ec460 100644
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -24,7 +24,7 @@ from onapsdk.exceptions import ModuleError
def test_global_settings():
"""Test global settings."""
- assert len(settings._settings) == 49
+ assert len(settings._settings) == 50
assert settings.AAI_URL == "https://aai.api.sparky.simpledemo.onap.org:30233"
assert settings.CDS_URL == "http://portal.api.simpledemo.onap.org:30449"
assert settings.SDNC_URL == "https://sdnc.api.simpledemo.onap.org:30267"
@@ -66,6 +66,7 @@ def test_global_settings():
assert hasattr(settings, "SO_AUTH")
assert hasattr(settings, "SO_CAT_DB_AUTH")
assert hasattr(settings, "SDC_SERVICE_DISTRIBUTION_COMPONENTS")
+ assert hasattr(settings, "SDC_SERVICE_DISTRIBUTION_DESIRED_STATE")
def test_settings_load_custom():
"""Test if custom settings is loaded correctly."""
diff --git a/tests/test_version.py b/tests/test_version.py
index 9afad27..488c129 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -17,4 +17,4 @@ import onapsdk.version as version
def test_version():
"""Check version is the right one."""
- assert version.__version__ == '13.0.6'
+ assert version.__version__ == '13.0.7'