diff --git a/singer_sdk/testing/suites.py b/singer_sdk/testing/suites.py index fd53e6e19..a61268759 100644 --- a/singer_sdk/testing/suites.py +++ b/singer_sdk/testing/suites.py @@ -36,6 +36,7 @@ TargetInvalidSchemaTest, TargetNoPrimaryKeys, TargetOptionalAttributes, + TargetPrimaryKeyUpdates, TargetRecordBeforeSchemaTest, TargetRecordMissingKeyProperty, TargetRecordMissingOptionalFields, @@ -104,6 +105,7 @@ class TestSuite(t.Generic[T]): # TargetMultipleStateMessages, TargetNoPrimaryKeys, TargetOptionalAttributes, + TargetPrimaryKeyUpdates, TargetRecordBeforeSchemaTest, TargetRecordMissingKeyProperty, TargetRecordMissingOptionalFields, diff --git a/singer_sdk/testing/target_test_streams/pk_updates.singer b/singer_sdk/testing/target_test_streams/pk_updates.singer new file mode 100644 index 000000000..c9b920599 --- /dev/null +++ b/singer_sdk/testing/target_test_streams/pk_updates.singer @@ -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"}} diff --git a/singer_sdk/testing/target_tests.py b/singer_sdk/testing/target_tests.py index 96e0b0d59..c9d5b94de 100644 --- a/singer_sdk/testing/target_tests.py +++ b/singer_sdk/testing/target_tests.py @@ -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."""