From 3fe8ed041885d68e909a65b644a52a8694429b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Mon, 21 Oct 2024 12:25:29 -0600 Subject: [PATCH] Add built-in test --- singer_sdk/testing/target_test_streams/pk_updates.singer | 4 ++++ singer_sdk/testing/target_tests.py | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 singer_sdk/testing/target_test_streams/pk_updates.singer 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."""