args = self._parse_args(args)
if not args_handler.check_suite(args.file):
- logger.error("ERROR: This suite file doesn't exist under benchmarks/suite/.\
+ logger.error("ERROR: This suite file %s doesn't exist under benchmarks/suite/.\
Please enter correct file." % str(args.file))
sys.exit(1)
import mock
import os
from func.cli import Cli
+from os.path import expanduser
class TestClass:
(['-l',
'zte',
'-f',
- 'compute'], "You have specified a lab that is not present in test_plan"),
+ 'compute'], "You have specified a lab that is not present under test_plan"),
(['-l',
'default',
'-f',
- 'test'], "This suite file doesn't exist under benchmarks/suite/")
+ 'test'], "This suite file test doesn't exist under benchmarks/suite/")
])
def test_cli_error(self, capfd, test_input, expected):
k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel', 'PWD': '/home'})
k.start()
Cli(test_input)
k.stop()
- resout, reserr = capfd.readouterr()
- assert expected in resout
+ with open(expanduser('~') + "/qtip/logs/cli.log", "r") as file:
+ data = file.read()
+ assert expected in data
@pytest.mark.parametrize("test_input, expected", [
(['-l',