Remove file path hardcodes
Make tests runnable in IDE.
Change-Id: I9901c10c319687a10616f634fca25297cf84df3a
Issue-ID: VNFSDK-375
Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
diff --git a/tests/packager/test_utils.py b/tests/packager/test_utils.py
index 3124ea5..2a2d98c 100644
--- a/tests/packager/test_utils.py
+++ b/tests/packager/test_utils.py
@@ -19,6 +19,14 @@
import pytest
from vnfsdk_pkgtools.packager import utils
+from vnfsdk_pkgtools import util
+
+ROOT_DIR = util.get_project_root()
+RESOURCES_DIR= os.path.join(ROOT_DIR, 'tests', 'resources', 'signature')
+
+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"
SHA256 = "20a480339aa4371099f9503511dcc5a8051ce3884846678ced5611ec64bbfc9c"
@@ -38,11 +46,6 @@
mocker.patch('requests.get', new=FakeRequest)
assert SHA256 == utils.cal_file_hash("", "http://fake", 'sha256')
-
-MSG_FILE = "tests/resources/signature/manifest.mf"
-CERT_FILE = "tests/resources/signature/test.crt"
-KEY_FILE = "tests/resources/signature/test.key"
-
def test_sign_verify_pairwise():
cms = utils.sign(MSG_FILE, CERT_FILE, KEY_FILE)
# We can't examine the exact content of cms because it contains timestamp