def test_all_predicates_have_classes(self):
        gc = gaffer_connector.GafferConnector(
            'http://localhost:8080/rest/latest')
        predicates = gc.execute_get(
            g.GetFilterFunctions()
        )
        predicates = json.loads(predicates)

        ignore_predicates = [
            'uk.gov.gchq.koryphe.predicate.AdaptedPredicate',
            'uk.gov.gchq.koryphe.predicate.AdaptedPredicate',
            'uk.gov.gchq.koryphe.predicate.PredicateComposite',
            'uk.gov.gchq.gaffer.rest.example.ExampleFilterFunction',
            'uk.gov.gchq.koryphe.tuple.predicate.TupleAdaptedPredicate',
            'uk.gov.gchq.gaffer.data.element.function.ElementFilter',
            'uk.gov.gchq.koryphe.tuple.predicate.TupleAdaptedPredicateComposite',
            'uk.gov.gchq.gaffer.store.util.AggregatorUtil$IsElementAggregated',
            'uk.gov.gchq.gaffer.graph.hook.migrate.predicate.TransformAndFilter'
        ]

        for i in ignore_predicates:
            if i in predicates: predicates.remove(i)

        for op in predicates:
            self.assertTrue(op in g.JsonConverter.GENERIC_JSON_CONVERTERS,
                            'Missing predicate class: ' + op)
예제 #2
0
def get_filter_functions(gc):
    # Get filter functions
    result = gc.execute_get(g.GetFilterFunctions())

    print('Filter Functions:')
    print(result)
    print()