Skip to content

Commit

Permalink
Add reproducing testcase for TypeError on None sub-expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Dec 24, 2018
1 parent 78939f7 commit ebf4222
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions graphql_compiler/tests/test_compiler.py
Expand Up @@ -2203,6 +2203,18 @@ def test_has_edge_degree_op_filter_with_optional(self):

check_test_data(self, test_data, expected_match, expected_gremlin)

def test_has_edge_degree_op_filter_with_optional_and_other_filter(self):
test_data = test_input_data.has_edge_degree_op_filter_with_optional_and_other_filter()

expected_match = '''
'''
expected_gremlin = '''
'''

check_test_data(self, test_data, expected_match, expected_gremlin)

def test_has_edge_degree_op_filter_with_fold(self):
test_data = test_input_data.has_edge_degree_op_filter_with_fold()

Expand Down
32 changes: 32 additions & 0 deletions graphql_compiler/tests/test_input_data.py
Expand Up @@ -1253,6 +1253,38 @@ def has_edge_degree_op_filter_with_optional():
type_equivalence_hints=None)


def has_edge_degree_op_filter_with_optional_and_other_filter():
graphql_input = '''{
Animal {
name @output(out_name: "animal_name")
uuid @filter(op_name: "between", value: ["$uuid_lower_bound","$uuid_upper_bound"])
in_Animal_ParentOf @optional
@filter(op_name: "has_edge_degree", value: ["$number_of_edges"]) {
out_Entity_Related {
... on Event {
name @output(out_name: "related_event")
}
}
}
}
}
'''
expected_output_metadata = {
'animal_name': OutputMetadata(type=GraphQLString, optional=False),
'related_event': OutputMetadata(type=GraphQLString, optional=True),
}
expected_input_metadata = {
'number_of_edges': GraphQLInt,
}

return CommonTestData(
graphql_input=graphql_input,
expected_output_metadata=expected_output_metadata,
expected_input_metadata=expected_input_metadata,
type_equivalence_hints=None)


def has_edge_degree_op_filter_with_fold():
graphql_input = '''{
Species {
Expand Down

0 comments on commit ebf4222

Please sign in to comment.