Esempio n. 1
0
    def test_integrity_with_wrong_type(self) -> None:
        # arrange
        samples, schema = DataLoader.create_dummy_samples()
        # noinspection PyTypeChecker
        samples[0]['random_string'] = 123

        # act
        result = self.inspector.inspect_attributes(samples, schema)

        # assert
        self.assertEqual(0.5, result.attribute_integrity)
Esempio n. 2
0
    def test_integrity_without_provided_schema(self) -> None:
        # arrange
        samples, _ = DataLoader.create_dummy_samples()

        # act
        empty_schema = SchemaDefinition.empty()
        result = self.inspector.inspect(samples, empty_schema)

        # assert
        self.assertEqual(1.0, result.attribute_integrity)
        self.assertEqual(.0, result.attribute_specification)
        self.assertEqual(.5, result.attribute_quality_index)