aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils/test_decorators.py
AgeCommit message (Collapse)AuthorFilesLines
2018-01-21Move push_results_to_db to TestCaseCédric Ollivier1-32/+31
It removes the link between TestCase and Functest utils (xtesting). It should be noted that testresults url can only be set by env var. Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com> Change-Id: Ie072c675890d0ae2e63619c599d2684a8c7d762d Signed-off-by: Jose Lausuch <jalausuch@suse.com> Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-06-01Use CONST to retrieve db_url rather than getter functionLinda Wang1-13/+6
1. Remove get_db_url() 2. If TEST_DB_URL declared in env, update test_db_url in config_functest.yaml file during env preparation 3. No matter TEST_DB_URL declared in env or not, Result_DB = CONST.__getattribute__("results_test_db_url") JIRA: FUNCTEST-763 Change-Id: I20da7ef98bbcc56731e0ff7061b05c1dde6cbfc3 Signed-off-by: Linda Wang <wangwulin@huawei.com>
2017-05-21Sort keys when dumping jsonCédric Ollivier1-1/+1
Otherwise dumping them could break some unit tests as they are unordered collections [1]. [1] https://build.opnfv.org/ci/job/functest-verify-master/4122/ Change-Id: I108e946926ae9690cf2421e565f2bb81500f9160 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-18Modify how to disable logging in unit test.Cédric Ollivier1-3/+1
Logs are only disabled when the unit tests are run from cmdline. It allows running them via pytest_suite_runner.py and printing their results to functest.log. You should notice that the unit test must disable the logger of the tested TestCase (e.g. testcase.TestCase.logger.disabled = 1). Otherwise false logs will be printed in console. Change-Id: Ic171e4575c8bab2e52db1897ae026b61a03b6247 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
2017-05-15Fully cover the decoratorCédric Ollivier1-0/+135
Change-Id: I1f1c938f0715e6afb7edbb8242f9a6c9cbfa65b5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>