Skip to content

Commit

Permalink
Add built-in test
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Oct 21, 2024
1 parent 42d8fd0 commit 4dab2f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions singer_sdk/testing/suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
TargetInvalidSchemaTest,
TargetNoPrimaryKeys,
TargetOptionalAttributes,
TargetPrimaryKeyUpdates,
TargetRecordBeforeSchemaTest,
TargetRecordMissingKeyProperty,
TargetRecordMissingOptionalFields,
Expand Down Expand Up @@ -104,6 +105,7 @@ class TestSuite(t.Generic[T]):
# TargetMultipleStateMessages,
TargetNoPrimaryKeys,
TargetOptionalAttributes,
TargetPrimaryKeyUpdates,
TargetRecordBeforeSchemaTest,
TargetRecordMissingKeyProperty,
TargetRecordMissingOptionalFields,
Expand Down
4 changes: 4 additions & 0 deletions singer_sdk/testing/target_test_streams/pk_updates.singer
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"type": "SCHEMA", "stream": "example_stream", "schema": {"properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "email": {"type": "string"}}, "key_properties": ["id"]}}
{"type": "RECORD", "stream": "example_stream", "record": {"id": 1, "name": "Alice", "email": "alice@example.com"}}
{"type": "SCHEMA", "stream": "example_stream", "schema": {"properties": {"id": {"type": "integer"}, "name": {"type": "string"}, "email": {"type": "string"}}, "key_properties": ["email"]}}
{"type": "RECORD", "stream": "example_stream", "record": {"id": 2, "name": "Bob", "email": "bob@example.com"}}
6 changes: 6 additions & 0 deletions singer_sdk/testing/target_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ class TargetSchemaUpdates(TargetFileTestTemplate):
name = "schema_updates"


class TargetPrimaryKeyUpdates(TargetFileTestTemplate):
"""Test Target handles Primary Key updates."""

name = "pk_updates"


class TargetSpecialCharsInAttributes(TargetFileTestTemplate):
"""Test Target handles special chars in attributes."""

Expand Down

0 comments on commit 4dab2f3

Please sign in to comment.