Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: convert python tuples into lists #312

Merged
merged 6 commits into from
Nov 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bindings/python/tests-py/test_jsonschema.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from collections import namedtuple
from contextlib import suppress
from functools import partial

Expand Down Expand Up @@ -87,6 +88,14 @@ def test_array_tuple_invalid(val):
validate(schema, val)


def test_named_tuple():
Person = namedtuple("Person", "first_name last_name")
person_a = Person("Joe", "Smith")
schema = {"type": "array", "items": {"type": "string"}}
with pytest.raises(ValueError):
Stranger6667 marked this conversation as resolved.
Show resolved Hide resolved
validate(schema, person_a)


def test_recursive_dict():
instance = {}
instance["foo"] = instance
Expand Down