Code Review
/
functest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Switch TestCase attribute criteria to result
[functest.git]
/
functest
/
tests
/
unit
/
utils
/
test_functest_utils.py
diff --git
a/functest/tests/unit/utils/test_functest_utils.py
b/functest/tests/unit/utils/test_functest_utils.py
index
eb241e5
..
7ab8b45
100644
(file)
--- a/
functest/tests/unit/utils/test_functest_utils.py
+++ b/
functest/tests/unit/utils/test_functest_utils.py
@@
-43,6
+43,7
@@
class FunctestUtilsTesting(unittest.TestCase):
self.db_url = 'test_db_url'
self.success_rate = 2.0
self.criteria = 'test_criteria==2.0'
self.db_url = 'test_db_url'
self.success_rate = 2.0
self.criteria = 'test_criteria==2.0'
+ self.result = 'PASS'
self.start_date = 1482624000
self.stop_date = 1482624000
self.start_time = time.time()
self.start_date = 1482624000
self.stop_date = 1482624000
self.start_time = time.time()
@@
-54,7
+55,8
@@
class FunctestUtilsTesting(unittest.TestCase):
self.cmd = 'test_cmd'
self.output_file = 'test_output_file'
self.testname = 'testname'
self.cmd = 'test_cmd'
self.output_file = 'test_output_file'
self.testname = 'testname'
- self.testcase_dict = {'name': 'testname', 'criteria': self.criteria}
+ self.testcase_dict = {'case_name': 'testname',
+ 'criteria': self.criteria}
self.parameter = 'general.openstack.image_name'
self.config_yaml = 'test_config_yaml-'
self.db_url_env = 'http://foo/testdb'
self.parameter = 'general.openstack.image_name'
self.config_yaml = 'test_config_yaml-'
self.db_url_env = 'http://foo/testdb'
@@
-278,7
+280,7
@@
class FunctestUtilsTesting(unittest.TestCase):
as mock_logger_error:
functest_utils.push_results_to_db(self.project, self.case_name,
self.start_date, self.stop_date,
as mock_logger_error:
functest_utils.push_results_to_db(self.project, self.case_name,
self.start_date, self.stop_date,
- self.
criteria
, self.details)
+ self.
result
, self.details)
mock_logger_error.assert_called_once_with("Please set env var: " +
str("\'" + env_var +
"\'"))
mock_logger_error.assert_called_once_with("Please set env var: " +
str("\'" + env_var +
"\'"))
@@
-310,7
+312,7
@@
class FunctestUtilsTesting(unittest.TestCase):
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
- self.
criteria
, self.details))
+ self.
result
, self.details))
mock_logger_error.assert_called_once_with(test_utils.
RegexMatch("Pushing "
"Result to"
mock_logger_error.assert_called_once_with(test_utils.
RegexMatch("Pushing "
"Result to"
@@
-333,7
+335,7
@@
class FunctestUtilsTesting(unittest.TestCase):
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
- self.
criteria
, self.details))
+ self.
result
, self.details))
self.assertTrue(mock_logger_error.called)
def test_push_results_to_db_default(self):
self.assertTrue(mock_logger_error.called)
def test_push_results_to_db_default(self):
@@
-348,7
+350,7
@@
class FunctestUtilsTesting(unittest.TestCase):
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
push_results_to_db(self.project, self.case_name,
self.start_date,
self.stop_date,
- self.
criteria
, self.details))
+ self.
result
, self.details))
readline = 0
test_ip = ['10.1.23.4', '10.1.14.15', '10.1.16.15']
readline = 0
test_ip = ['10.1.23.4', '10.1.14.15', '10.1.16.15']