def test_proper_dataset_export(self): file_path = '/tmp/test_config.yaml' writer.export_evaluation_to_config(self.evaluation, file_path=file_path) data = yaml.load(open(file_path, 'r')) self.assertTrue('datasets' in data) self.assertTrue('reference' in data['datasets']) self.assertTrue('targets' in data['datasets']) self.assertAlmostEqual( writer.generate_dataset_information(self.evaluation), data['datasets'])
def test_proper_dataset_export(self): file_path = '/tmp/test_config.yaml' writer.export_evaluation_to_config( self.evaluation, file_path=file_path ) data = yaml.load(open(file_path, 'r')) self.assertTrue('datasets' in data) self.assertTrue('reference' in data['datasets']) self.assertTrue('targets' in data['datasets']) self.assertAlmostEqual( writer.generate_dataset_information(self.evaluation), data['datasets'] )
def test_proper_target_datasets_export(self): out = writer.generate_dataset_information(self.evaluation) self.assertTrue('targets' in out) self.assertTrue(type(out['targets']) == type(list())) self.assertTrue(len(out['targets']) == 3)
def test_proper_reference_dataset_export(self): out = writer.generate_dataset_information(self.evaluation) self.assertTrue('reference' in out) self.assertTrue(out['reference']['data_source'] == 'local')
def test_contains_only_target_datasets(self): new_eval = Evaluation(None, [self.local_ds], []) out = writer.generate_dataset_information(new_eval) self.assertTrue('reference' not in out) self.assertTrue('targets' in out)