From 1ee29e00b88d8a4dde7a02575ad416f1615d1c7c Mon Sep 17 00:00:00 2001 From: Lianhao Lu Date: Fri, 1 Nov 2019 16:01:34 +0800 Subject: Added python3 support Change-Id: I7a09d11cc6506e91327d96e06a9d1001c9567380 Issue-ID: VNFSDK-419 Signed-off-by: Lianhao Lu --- tests/packager/test_manifest.py | 2 +- tests/packager/test_utils.py | 2 +- tests/validator/test_validate_utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/packager/test_manifest.py b/tests/packager/test_manifest.py index 2383284..003e23e 100644 --- a/tests/packager/test_manifest.py +++ b/tests/packager/test_manifest.py @@ -126,7 +126,7 @@ def test_update_to_file(tmpdir): m2 = manifest.Manifest(mf.dirname, 'test.mf') assert m1.metadata['vnf_provider_id'] == m2.metadata['vnf_provider_id'] assert m1.digests['digest'] == m2.digests['digest2'] - assert len(m2.digests.keys()) == 2 + assert len(list(m2.digests.keys())) == 2 assert m2.signature == CMS def test_signature(tmpdir): diff --git a/tests/packager/test_utils.py b/tests/packager/test_utils.py index 2a2d98c..7456302 100644 --- a/tests/packager/test_utils.py +++ b/tests/packager/test_utils.py @@ -28,7 +28,7 @@ MSG_FILE = os.path.join(RESOURCES_DIR, 'manifest.mf') CERT_FILE = os.path.join(RESOURCES_DIR, 'test.crt') KEY_FILE = os.path.join(RESOURCES_DIR, 'test.key') -CONTENT = "needToBeHashed" +CONTENT = b"needToBeHashed" SHA256 = "20a480339aa4371099f9503511dcc5a8051ce3884846678ced5611ec64bbfc9c" SHA512 = "dbed8672e752d51d0c7ca42050f67faf1534e58470bba96e787df5c4cf6a4f8ecf7ad45fb9307adbc5b9dec8432627d86b3eb1d3d43ee9c5e93f754ff2825320" diff --git a/tests/validator/test_validate_utils.py b/tests/validator/test_validate_utils.py index 2c36a3b..1d663e5 100644 --- a/tests/validator/test_validate_utils.py +++ b/tests/validator/test_validate_utils.py @@ -39,4 +39,4 @@ def test_load_bad_definition(tmpdir): def test_load_defualt_definition(tmpdir): p = tmpdir.join("non_exist") - assert 1 == utils.load_definitions(str(p),defaults=1) + assert 1 == utils.load_definitions(str(p), defaults=1) -- cgit 1.2.3-korg