Skip to content

Commit

Permalink
Test that from_global_id handles invalid code point
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Apr 16, 2022
1 parent 4c69f4f commit d7cdfb3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/connection/test_array_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,18 @@ def throws_an_error_if_last_smaller_than_zero():
)

def returns_all_elements_if_cursors_are_invalid():
c = connection_from_array(
array_abcde, dict(before="invalid", after="invalid")
c1 = connection_from_array(
array_abcde, dict(before="InvalidBase64", after="InvalidBase64")
)
assert c == Connection(

invalid_unicode_in_base64 = "9JCAgA==" # U+110000
c2 = connection_from_array(
array_abcde,
dict(before=invalid_unicode_in_base64, after=invalid_unicode_in_base64),
)

assert c1 == c2
assert c1 == Connection(
edges=[edge_a, edge_b, edge_c, edge_d, edge_e],
pageInfo=PageInfo(
startCursor=cursor_a,
Expand Down

0 comments on commit d7cdfb3

Please sign in to comment.