5 def test_config_normal(mocker, config_normal):
7 'argparse.ArgumentParser.parse_known_args',
8 return_value=(argparse.Namespace(config_file=config_normal), None))
9 from opnfv_testapi.common import config
10 CONF = config.Config()
11 assert CONF.mongo_url == 'mongodb://127.0.0.1:27017/'
12 assert CONF.mongo_dbname == 'test_results_collection'
13 assert CONF.api_port == 8000
14 assert CONF.api_debug is True
15 assert CONF.api_authenticate is False
16 assert CONF.ui_url == 'http://localhost:8000'
19 def test_config_file_not_exist(mocker):
20 mocker.patch('os.path.exists', return_value=False)
21 with pytest.raises(Exception) as m_exc:
22 from opnfv_testapi.common import config
24 assert 'not found' in str(m_exc.value)