diff options
author | hongbo tian <hongbo.tianhongbo@huawei.com> | 2016-12-26 06:32:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-26 06:32:55 +0000 |
commit | 5eb35fabf62a8b17089fdf4608d00ef0c55c8cfa (patch) | |
tree | c70e72605f0b0b4a77ed08b4ac548ea927ef3440 | |
parent | 54912a083579570d7369490fe99973af5cb358bb (diff) | |
parent | a9ba402b37fd8bd3c80389c83ee3b812d8cc4594 (diff) |
Merge "dovetail tool: bugfix CI job dovetail-merge-master fail"
-rw-r--r-- | dovetail/tests/unit/test_parser.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dovetail/tests/unit/test_parser.py b/dovetail/tests/unit/test_parser.py index 5fb4dbb9..7047d5ce 100644 --- a/dovetail/tests/unit/test_parser.py +++ b/dovetail/tests/unit/test_parser.py @@ -15,11 +15,13 @@ import logging import os import unittest import yaml +import mock from dovetail import parser from dovetail.utils.dovetail_config import DovetailConfig as dt_cfg +@mock.patch('dovetail.parser.Parser.logger') class TestParser(unittest.TestCase): test_path = os.path.dirname(os.path.realpath(__file__)) @@ -27,10 +29,9 @@ class TestParser(unittest.TestCase): def setUp(self): """Test case setup""" dt_cfg.load_config_files() - parser.Parser.create_log() logging.disable(logging.CRITICAL) - def test_parser_cmd(self): + def test_parser_cmd(self, mock_logger): """Test whether the command is correctly parsed.""" mock_cmd = "python /functest/ci/run_tests.py "\ "-t {{validate_testcase}} -r" @@ -44,7 +45,7 @@ class TestParser(unittest.TestCase): "tempest_smoke_serial -r") self.assertEqual(expected_output, output) - def test_parser_cmd_fail(self): + def test_parser_cmd_fail(self, mock_logger): """Test whether the command is correctly parsed.""" mock_cmd = "python /functest/ci/run_tests.py "\ "-t {{validate_testcase}} -r" |