1010from airbyte_cdk .sources .utils .schema_helpers import check_config_against_spec_or_exit
1111
1212
13- def test_check_config_against_spec_with_dynamic_schema_loader ():
14- """Test that check_config_against_spec is False when DynamicSchemaLoader is used."""
13+ def test_check_config_during_discover_with_dynamic_schema_loader ():
14+ """Test that check_config_during_discover is True when DynamicSchemaLoader is used."""
1515 source_config = {
1616 "type" : "DeclarativeSource" ,
1717 "check" : {"type" : "CheckStream" },
@@ -41,11 +41,12 @@ def test_check_config_against_spec_with_dynamic_schema_loader():
4141
4242 source = ManifestDeclarativeSource (source_config = source_config )
4343
44- assert source .check_config_against_spec is False
44+ assert source .check_config_during_discover is True
45+ assert source .check_config_against_spec is True
4546
4647
47- def test_check_config_against_spec_without_dynamic_schema_loader ():
48- """Test that check_config_against_spec is True when DynamicSchemaLoader is not used."""
48+ def test_check_config_during_discover_without_dynamic_schema_loader ():
49+ """Test that check_config_during_discover is False when DynamicSchemaLoader is not used."""
4950 source_config = {
5051 "type" : "DeclarativeSource" ,
5152 "check" : {"type" : "CheckStream" },
@@ -64,6 +65,9 @@ def test_check_config_against_spec_without_dynamic_schema_loader():
6465 }
6566
6667 source = ManifestDeclarativeSource (source_config = source_config )
68+
69+ assert source .check_config_during_discover is False
70+ assert source .check_config_against_spec is True
6771
6872
6973@patch (
@@ -109,7 +113,8 @@ def test_discover_with_dynamic_schema_loader_no_config(mock_streams):
109113
110114 source = ManifestDeclarativeSource (source_config = source_config )
111115
112- assert source .check_config_against_spec is False
116+ assert source .check_config_during_discover is True
117+ assert source .check_config_against_spec is True
113118
114119 logger = MagicMock ()
115120 catalog = source .discover (logger , {})
@@ -152,6 +157,7 @@ def test_discover_without_dynamic_schema_loader_no_config(mock_streams):
152157
153158 source = ManifestDeclarativeSource (source_config = source_config )
154159
160+ assert source .check_config_during_discover is False
155161 assert source .check_config_against_spec is True
156162
157163 logger = MagicMock ()
@@ -161,4 +167,5 @@ def test_discover_without_dynamic_schema_loader_no_config(mock_streams):
161167 assert len (catalog .streams ) == 1
162168 assert catalog .streams [0 ].name == "test_static_stream"
163169
170+ assert source .check_config_during_discover is False
164171 assert source .check_config_against_spec is True
0 commit comments