diff --git a/tests/core/test_plugin_base.py b/tests/core/test_plugin_base.py index 2bc30ae2e..7f47435cd 100644 --- a/tests/core/test_plugin_base.py +++ b/tests/core/test_plugin_base.py @@ -1,10 +1,15 @@ from __future__ import annotations +import typing as t + import pytest from singer_sdk.plugin_base import SDK_PACKAGE_NAME, MapperNotInitialized, PluginBase from singer_sdk.typing import IntegerType, PropertiesList, Property, StringType +if t.TYPE_CHECKING: + from pathlib import Path + class PluginTest(PluginBase): """Example Plugin for tests.""" @@ -16,6 +21,18 @@ class PluginTest(PluginBase): ).to_dict() +def test_config_path(tmp_path: Path): + """Test that the config path is correctly set.""" + config_json = '{"prop1": "hello", "prop2": 123}' + config_path = tmp_path / "config.json" + config_path.write_text(config_json) + + with pytest.deprecated_call(): + plugin = PluginTest(config=config_path) + + assert plugin.config == {"prop1": "hello", "prop2": 123} + + def test_invalid_config_type(): """Test that invalid config types raise an error.""" with pytest.raises(TypeError, match="Error parsing config of type 'tuple'"):