def passes_graphql_error_ish_through(): e = Exception('I am an ordinary exception') e.locations = [] e.path = [] e.nodes = [] e.source = None e.positions = [] assert located_error(e, [], []) == e
def throws_without_an_original_error(): e = located_error([], [], []).original_error # type: ignore assert isinstance(e, TypeError) assert str(e) == "Unexpected error value: []"
def does_not_pass_through_elasticsearch_like_errors(): e = Exception("I am from elasticsearch") cast(Any, e).path = "/something/feed/_search" assert located_error(e, [], []) is not e
def passes_graphql_error_ish_through(): e = GraphQLError("I am a located GraphQL error") e.path = [] assert located_error(e, [], []) is e
def passes_graphql_error_through(): path = ["path", 3, "to", "field"] e = GraphQLError("msg", None, None, None, cast(Any, path)) assert located_error(e, [], []) == e
def passes_graphql_error_through(): path = ['path', 3, 'to', 'field'] # noinspection PyArgumentEqualDefault e = GraphQLError('msg', None, None, None, path) assert located_error(e, [], []) == e
def does_not_pass_through_elasticsearch_like_errors(): e = Exception('I am from elasticsearch') e.path = '/something/feed/_search' assert located_error(e, [], []) != e
def throws_without_an_original_error(): with raises(TypeError) as exc_info: # noinspection PyTypeChecker located_error([], [], []) # type: ignore assert str(exc_info.value) == "Expected an Exception."
def passes_graphql_error_through(): path = ["path", 3, "to", "field"] # noinspection PyArgumentEqualDefault e = GraphQLError("msg", None, None, None, path) # type: ignore assert located_error(e, [], []) == e
def does_not_pass_through_elasticsearch_like_errors(): e = Exception("I am from elasticsearch") # noinspection PyTypeHints e.path = "/something/feed/_search" # type: ignore assert located_error(e, [], []) is not e