diff options
Diffstat (limited to 'xtesting/tests/unit/core/test_testcase.py')
-rw-r--r-- | xtesting/tests/unit/core/test_testcase.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/xtesting/tests/unit/core/test_testcase.py b/xtesting/tests/unit/core/test_testcase.py index 63bfc3fe..990883c6 100644 --- a/xtesting/tests/unit/core/test_testcase.py +++ b/xtesting/tests/unit/core/test_testcase.py @@ -22,6 +22,7 @@ import mock import requests from xtesting.core import testcase +from xtesting.utils import constants __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>" @@ -400,19 +401,21 @@ class TestCaseTesting(unittest.TestCase): mock.call().meta.client.head_bucket(Bucket='xtesting'), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/xtesting.log', - 'prefix/xtesting.log', + constants.LOG_PATH, + os.path.join('prefix', os.path.basename(constants.LOG_PATH)), Config=mock.ANY, ExtraArgs={'ContentType': 'application/octet-stream'}), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/xtesting.debug.log', - 'prefix/xtesting.debug.log', + constants.DEBUG_LOG_PATH, + os.path.join('prefix', + os.path.basename(constants.DEBUG_LOG_PATH)), Config=mock.ANY, ExtraArgs={'ContentType': 'application/octet-stream'}), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/bar', 'prefix/bar', + os.path.join(constants.RESULTS_DIR, 'bar'), + 'prefix/bar', Config=mock.ANY, ExtraArgs={'ContentType': 'application/octet-stream'})] self.assertEqual(args[1].mock_calls, expected) @@ -432,19 +435,21 @@ class TestCaseTesting(unittest.TestCase): mock.call().meta.client.head_bucket(Bucket='xtesting'), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/xtesting.log', - 'prefix/xtesting.log', + constants.LOG_PATH, + os.path.join('prefix', os.path.basename(constants.LOG_PATH)), Config=mock.ANY, ExtraArgs={'ContentType': 'text/plain'}), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/xtesting.debug.log', - 'prefix/xtesting.debug.log', + constants.DEBUG_LOG_PATH, + os.path.join('prefix', + os.path.basename(constants.DEBUG_LOG_PATH)), Config=mock.ANY, ExtraArgs={'ContentType': 'text/plain'}), mock.call().Bucket('xtesting'), mock.call().Bucket().upload_file( - '/var/lib/xtesting/results/bar', 'prefix/bar', + os.path.join(constants.RESULTS_DIR, 'bar'), + 'prefix/bar', Config=mock.ANY, ExtraArgs={'ContentType': 'text/plain'})] self.assertEqual(args[1].mock_calls, expected) |