From a05c8afed68c2c354f323bab4eec75b8b19edf85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Wed, 20 Dec 2023 15:45:06 -0600 Subject: [PATCH] Test SQL target capabilities info --- tests/core/targets/__init__.py | 0 tests/core/targets/test_target_sql.py | 32 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/core/targets/__init__.py create mode 100644 tests/core/targets/test_target_sql.py diff --git a/tests/core/targets/__init__.py b/tests/core/targets/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/core/targets/test_target_sql.py b/tests/core/targets/test_target_sql.py new file mode 100644 index 0000000000..50f25737c3 --- /dev/null +++ b/tests/core/targets/test_target_sql.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +import typing as t + +from singer_sdk.helpers.capabilities import PluginCapabilities, TargetCapabilities +from singer_sdk.target_base import SQLTarget + + +class SQLTargetMock(SQLTarget): + name = "sql-target-mock" + config_jsonschema: t.ClassVar[dict] = {"properties": {}} + + +def test_target_about_info(): + target = SQLTargetMock() + about = target._get_about_info() + + assert about.capabilities == [ + PluginCapabilities.ABOUT, + PluginCapabilities.STREAM_MAPS, + PluginCapabilities.FLATTENING, + TargetCapabilities.TARGET_SCHEMA, + TargetCapabilities.HARD_DELETE, + ] + + assert "stream_maps" in about.settings["properties"] + assert "stream_map_config" in about.settings["properties"] + assert "flattening_enabled" in about.settings["properties"] + assert "flattening_max_depth" in about.settings["properties"] + assert "add_record_metadata" in about.settings["properties"] + assert "default_target_schema" in about.settings["properties"] + assert "hard_delete" in about.settings["properties"]