예제 #1
0
    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'])
예제 #2
0
    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']
        )
예제 #3
0
    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)
예제 #4
0
    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')
예제 #5
0
    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)
예제 #6
0
    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)
예제 #7
0
    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')
예제 #8
0
    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)