aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpaweldenst <pawel.denst@external.t-mobile.pl>2022-10-25 11:37:03 +0000
committerpaweldenst <pawel.denst@external.t-mobile.pl>2022-11-25 08:14:07 +0000
commit1b6a93d93fe6ac41eb221dc59c2171e9bdd578e3 (patch)
tree426764fe83cf6313f7b04e94afdc892ff1056df4 /tests
parent25cafb994c9ba3b874cd973a1e1d440fb0b98bf0 (diff)
Run Python 3.11 tests
This commit deletes unnecessary comments Issue-ID: INT-2168 Signed-off-by: paweldenst <pawel.denst@external.t-mobile.pl> Change-Id: I08b738d3a9aebbdf5d305a118a4d7b7e64d686a5
Diffstat (limited to 'tests')
-rw-r--r--tests/test_configuration.py4
-rwxr-xr-xtests/test_service.py13
2 files changed, 7 insertions, 10 deletions
diff --git a/tests/test_configuration.py b/tests/test_configuration.py
index 70ae14a..d35776c 100644
--- a/tests/test_configuration.py
+++ b/tests/test_configuration.py
@@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from onapsdk.utils.configuration import tosca_path
from onapsdk.utils.configuration import components_needing_distribution
-def test_tosca_path():
- assert tosca_path() == "/tmp/tosca_files/"
-
def test_components_needing_distribution():
assert "SO" in components_needing_distribution()
assert "sdnc" in components_needing_distribution()
diff --git a/tests/test_service.py b/tests/test_service.py
index e486833..7606ed2 100755
--- a/tests/test_service.py
+++ b/tests/test_service.py
@@ -18,10 +18,8 @@ from pathlib import Path
from unittest import mock
from unittest.mock import MagicMock, PropertyMock
import shutil
-
import oyaml as yaml
import pytest
-
import onapsdk.constants as const
from onapsdk.exceptions import ParameterError, RequestError, ResourceNotFound, StatusError, ValidationError
from onapsdk.sdc.category_management import ServiceCategory
@@ -513,7 +511,7 @@ def test_get_tosca_no_result(mock_send):
mock_send.return_value = {}
svc = Service()
svc.identifier = "12"
- svc.get_tosca()
+ svc.get_tosca('/tmp/tosca_files')
headers = headers_sdc_creator(svc.headers)
headers['Accept'] = 'application/octet-stream'
mock_send.assert_called_once_with(
@@ -533,7 +531,8 @@ def test_get_tosca_bad_csart(requests_mock):
requests_mock.get(
'https://sdc.api.be.simpledemo.onap.org:30204/sdc/v1/catalog/services/12/toscaModel',
content=file_content)
- svc.get_tosca()
+ svc.get_tosca('directory')
+ assert not path.exists('/tmp/tosca_files')
def test_get_tosca_result(requests_mock):
@@ -546,7 +545,9 @@ def test_get_tosca_result(requests_mock):
content=file_content)
svc = Service()
svc.identifier = "12"
- svc.get_tosca()
+ svc.get_tosca('directory')
+ assert not path.exists('/tmp/tosca_files')
+
def test_get_tosca_result_no_service_in_csar(requests_mock):
if path.exists('/tmp/tosca_files'):
@@ -559,7 +560,7 @@ def test_get_tosca_result_no_service_in_csar(requests_mock):
svc = Service()
svc.identifier = "12"
with pytest.raises(ValidationError):
- svc.get_tosca()
+ svc.get_tosca('directory')
@mock.patch.object(Service, 'send_message_json')
def test_distributed_api_error(mock_send):