From b04abccfdede16175f14fb5020a57434fcd258ee Mon Sep 17 00:00:00 2001 From: Prakhar Srivastava Date: Wed, 11 Oct 2023 16:15:29 +0200 Subject: [PATCH] Added tests --- singer_sdk/_singerlib/schema.py | 1 + tests/_singerlib/test_schema.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/singer_sdk/_singerlib/schema.py b/singer_sdk/_singerlib/schema.py index 84b584f05..41dd8104b 100644 --- a/singer_sdk/_singerlib/schema.py +++ b/singer_sdk/_singerlib/schema.py @@ -48,6 +48,7 @@ class Schema: """ type: str | list[str] | None = None # noqa: A003 + default: t.Any | None = None properties: dict | None = None items: t.Any | None = None description: str | None = None diff --git a/tests/_singerlib/test_schema.py b/tests/_singerlib/test_schema.py index 07589f431..587130824 100644 --- a/tests/_singerlib/test_schema.py +++ b/tests/_singerlib/test_schema.py @@ -4,10 +4,10 @@ from singer_sdk._singerlib import Schema, resolve_schema_references -STRING_SCHEMA = Schema(type="string", maxLength=32) -STRING_DICT = {"type": "string", "maxLength": 32} -INTEGER_SCHEMA = Schema(type="integer", maximum=1000000) -INTEGER_DICT = {"type": "integer", "maximum": 1000000} +STRING_SCHEMA = Schema(type="string", maxLength=32, default="") +STRING_DICT = {"type": "string", "maxLength": 32 , "default":""} +INTEGER_SCHEMA = Schema(type="integer", maximum=1000000, default=0) +INTEGER_DICT = {"type": "integer", "maximum": 1000000, "default":0} ARRAY_SCHEMA = Schema(type="array", items=INTEGER_SCHEMA) ARRAY_DICT = {"type": "array", "items": INTEGER_DICT} OBJECT_SCHEMA = Schema(