Skip to content

Commit 94e9e6e

Browse files
committed
more conflict resolution
1 parent 1837f81 commit 94e9e6e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unit/test_schema.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,18 @@ def test_valid_mapping_representation(self, schema, expected_schema):
906906
result = _to_schema_fields(schema)
907907
assert result == expected_schema
908908

909+
def test_valid_schema_object(self):
910+
schema = Schema(
911+
fields=[SchemaField("name", "STRING")],
912+
foreign_type_info="TestInfo",
913+
)
914+
result = _to_schema_fields(schema)
915+
expected = Schema(
916+
[SchemaField("name", "STRING", "NULLABLE", None, None, (), None)],
917+
"TestInfo",
918+
)
919+
assert result.to_api_repr() == expected.to_api_repr()
920+
909921

910922
# Testing the new Schema Class =================
911923
class TestSchemaObject: # New test class for Schema object interactions
@@ -930,6 +942,16 @@ def test_schema_object_foreign_type_info(self):
930942
with pytest.raises(TypeError):
931943
schema.foreign_type_info = 123 # Type check
932944

945+
def test_str(self):
946+
schema = Schema(
947+
fields=[SchemaField("name", "STRING")],
948+
foreign_type_info="TestInfo",
949+
)
950+
assert (
951+
str(schema)
952+
== "Schema([SchemaField('name', 'STRING', 'NULLABLE', None, None, (), None)], TestInfo)"
953+
)
954+
933955
@pytest.mark.parametrize(
934956
"schema, expected_repr",
935957
[

0 commit comments

Comments
 (0)