def test_common_params_receiving(self): """ Tests merging of internal and external parameters if config option is given """ external_config = read_config_file('config.json') config = get_common_params(external_config) self.assertTrue('log_dir' in config) self.assertTrue('REPORT_DIR' in config)
def test_success_report_existance_validation(self): """ Tests success report validation if js library is present """ external_config = read_config_file('config.json') config = get_common_params(external_config) if not os.path.exists(config.get('REPORT_DIR')): os.makedirs(config.get('REPORT_DIR')) file_path = '{}/jquery.tablesorter.min.js'.format( config.get('REPORT_DIR')) f = open(file_path, 'a') f.close() self.assertTrue(validate_config(config)) os.remove(file_path)
def test_failed_report_existence_validation(self): """ Tests failed report validation if js library is abscent """ external_config = read_config_file('config.json') config = get_common_params(external_config) self.assertFalse(validate_config(config))
def test_read_yml_file(self): """ Test success reading of the yml config """ config = read_config_file('config.yml') self.assertIsNotNone(config)
def test_read_json_config(self): """ Test success reading of the json config """ config = read_config_file('config.json') self.assertIsNotNone(config)
def test_read_config_file_if_config_file_is_not_exists(self): self.assertEqual( log_analyzer.read_config_file("hjfueybcvnsdf", self.config), None)