summaryrefslogtreecommitdiffstats
path: root/dovetail/tests/unit/test_report.py
diff options
context:
space:
mode:
authorPanagiotis Karalis <panos.pkaralis@gmail.com>2019-08-07 10:46:52 +0300
committerDan Xu <xudan16@huawei.com>2019-09-16 06:45:00 +0000
commit005d868d68dbb0e70b3f92a685ea269c4f646fd7 (patch)
treedcb1f0f64606b58f0c33e9dc96131fdbe4ed6398 /dovetail/tests/unit/test_report.py
parentf0c44b1ae02ffbdb87da81dac7b6754c641d8c04 (diff)
Move the proj to python3
The aim of this patch is to upgrade python version of this project from python2 to python3. Signed-off-by: Panagiotis Karalis <panos.pkaralis@gmail.com> Change-Id: I3d3ef01176fda1b23a0542a24625be2f3368c40e
Diffstat (limited to 'dovetail/tests/unit/test_report.py')
-rw-r--r--dovetail/tests/unit/test_report.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/dovetail/tests/unit/test_report.py b/dovetail/tests/unit/test_report.py
index f89d0e40..fe6530c9 100644
--- a/dovetail/tests/unit/test_report.py
+++ b/dovetail/tests/unit/test_report.py
@@ -460,7 +460,7 @@ class ReportTesting(unittest.TestCase):
report.logger.info.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json')
@patch('dovetail.report.os.path')
@patch('dovetail.report.dt_cfg')
@@ -483,7 +483,7 @@ class ReportTesting(unittest.TestCase):
mock_json.dumps.assert_called_once_with('results')
file_obj.write.assert_called_once_with('results text\n')
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json')
@patch('dovetail.report.os.path')
@patch('dovetail.report.dt_cfg')
@@ -640,7 +640,7 @@ class ReportTesting(unittest.TestCase):
'Result file not found: {}'.format(file_path))
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json')
@patch('dovetail.report.dt_cfg')
@patch('dovetail.report.dt_utils')
@@ -695,7 +695,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.name.assert_called_once_with()
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json')
@patch('dovetail.report.dt_cfg')
@patch('dovetail.report.dt_utils')
@@ -750,7 +750,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.name.assert_called_once_with()
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.dt_cfg')
@patch('dovetail.report.dt_utils')
@@ -841,7 +841,7 @@ class ReportTesting(unittest.TestCase):
'Result file not found: {}'.format(file_path))
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.dt_utils')
@patch('dovetail.report.os.path')
@@ -883,7 +883,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.dt_utils')
@patch('dovetail.report.os.path')
@@ -942,7 +942,7 @@ class ReportTesting(unittest.TestCase):
'Result file not found: {}'.format(file_path))
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_bottlenecks_crawler_crawl_pass(self, mock_path, mock_loads,
@@ -970,7 +970,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_bottlenecks_crawler_crawl_fail(self, mock_path, mock_loads,
@@ -998,7 +998,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_bottlenecks_crawler_crawl_key_error(self, mock_path, mock_loads,
@@ -1036,7 +1036,7 @@ class ReportTesting(unittest.TestCase):
mock_path.exists.assert_called_once_with(file_path)
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.path')
def test_shell_crawler_crawl_exception(self, mock_path, mock_open):
mock_path.exists.return_value = True
@@ -1050,7 +1050,7 @@ class ReportTesting(unittest.TestCase):
mock_open.assert_called_once_with(file_path, 'r')
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.load')
@patch('dovetail.report.os.path')
def test_shell_crawler_crawl(self, mock_path, mock_load,
@@ -1121,7 +1121,7 @@ class ReportTesting(unittest.TestCase):
'Result file not found: {}'.format(file_path))
self.assertEqual(None, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.path')
def test_onapvvp_crawler_crawl_pass(self, mock_path,
mock_open):
@@ -1143,7 +1143,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.path')
def test_onapvvp_crawler_crawl_fail(self, mock_path,
mock_open):
@@ -1165,7 +1165,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.path')
def test_onapvvp_crawler_crawl_value_exception(self, mock_path,
mock_open):
@@ -1189,7 +1189,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.path')
def test_onapvvp_crawler_crawl_key_exception(self, mock_path,
mock_open):
@@ -1213,7 +1213,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_onapvtp_crawler_crawl_pass(self, mock_path, mock_loads,
@@ -1243,7 +1243,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_onapvtp_crawler_crawl_fail(self, mock_path, mock_loads,
@@ -1273,7 +1273,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_onapvtp_crawler_crawl_no_criteria(self, mock_path, mock_loads,
@@ -1305,7 +1305,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_onapvtp_crawler_crawl_exception(self, mock_path, mock_loads,
@@ -1337,7 +1337,7 @@ class ReportTesting(unittest.TestCase):
testcase_obj.set_results.assert_called_once_with(expected)
self.assertEqual(expected, result)
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.json.loads')
@patch('dovetail.report.os.path')
def test_onapvtp_crawler_crawl_value_error(self, mock_path, mock_loads,
@@ -1604,7 +1604,7 @@ class ReportTesting(unittest.TestCase):
@patch('dovetail.report.dt_cfg')
@patch('dovetail.report.os.path')
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.getenv')
def test_get_checksum_tosca(self, mock_env, mock_open, mock_path,
mock_config):
@@ -1625,7 +1625,7 @@ class ReportTesting(unittest.TestCase):
@patch('dovetail.report.dt_cfg')
@patch('dovetail.report.os.path')
@patch('dovetail.report.os.walk')
- @patch('__builtin__.open')
+ @patch('builtins.open')
@patch('dovetail.report.os.getenv')
def test_get_checksum_heat(self, mock_env, mock_open, mock_walk, mock_path,
mock_config):