@@ -31,61 +31,6 @@ def test_build_catalog_creates_correct_structure(self):
3131 assert configured_stream .sync_mode == SyncMode .incremental
3232 assert configured_stream .destination_sync_mode == DestinationSyncMode .overwrite
3333
34- @patch ("airbyte_cdk.manifest_server.command_processor.utils.ConcurrentDeclarativeSource" )
35- def test_build_source_creates_source (self , mock_source_class ):
36- """Test that build_source creates a ConcurrentDeclarativeSource with correct parameters."""
37- # Setup mocks
38- mock_source = Mock ()
39- mock_source_class .return_value = mock_source
40-
41- # Test with complex manifest and config structures
42- manifest = {
43- "version" : "0.1.0" ,
44- "definitions" : {"selector" : {"extractor" : {"field_path" : ["data" ]}}},
45- "streams" : [
46- {
47- "name" : "users" ,
48- "primary_key" : "id" ,
49- "retriever" : {
50- "requester" : {
51- "url_base" : "https://api.example.com" ,
52- "path" : "/users" ,
53- }
54- },
55- }
56- ],
57- "check" : {"stream_names" : ["users" ]},
58- }
59-
60- config = {
61- "api_key" : "sk-test-123" ,
62- "base_url" : "https://api.example.com" ,
63- "timeout" : 30 ,
64- }
65-
66- # Call build_source with additional parameters
67- catalog = build_catalog ("test_stream" )
68- state = []
69- result = build_source (manifest , catalog , config , state )
70-
71- # Verify ConcurrentDeclarativeSource was created with correct parameters
72- expected_source_config = {
73- ** manifest ,
74- "concurrency_level" : {"type" : "ConcurrencyLevel" , "default_concurrency" : 1 },
75- }
76- mock_source_class .assert_called_once_with (
77- catalog = catalog ,
78- state = state ,
79- source_config = expected_source_config ,
80- config = config ,
81- normalize_manifest = False , # Default when flag not set
82- migrate_manifest = False , # Default when flag not set
83- emit_connector_builder_messages = True ,
84- limits = mock_source_class .call_args [1 ]["limits" ],
85- )
86-
87- assert result == mock_source
88-
8934 @patch ("airbyte_cdk.manifest_server.command_processor.utils.ConcurrentDeclarativeSource" )
9035 def test_build_source_with_normalize_flag (self , mock_source_class ):
9136 """Test build_source when normalize flag is set."""
0 commit comments