|
2 | 2 | # Copyright (c) 2024 Airbyte, Inc., all rights reserved. |
3 | 3 | # |
4 | 4 |
|
5 | | -import json |
6 | 5 | from unittest.mock import MagicMock |
7 | 6 |
|
8 | 7 | import pytest |
9 | 8 |
|
10 | | -from airbyte_cdk.sources.declarative.concurrent_declarative_source import ( |
11 | | - ConcurrentDeclarativeSource, |
12 | | -) |
13 | 9 | from airbyte_cdk.sources.declarative.schema import InferredSchemaLoader |
14 | | -from airbyte_cdk.test.mock_http import HttpMocker, HttpRequest, HttpResponse |
15 | | - |
16 | | -_CONFIG = { |
17 | | - "start_date": "2024-07-01T00:00:00.000Z", |
18 | | - "api_key": "test_api_key", |
19 | | -} |
20 | | - |
21 | | -_MANIFEST = { |
22 | | - "version": "6.7.0", |
23 | | - "definitions": { |
24 | | - "users_stream": { |
25 | | - "type": "DeclarativeStream", |
26 | | - "name": "users", |
27 | | - "primary_key": [], |
28 | | - "retriever": { |
29 | | - "type": "SimpleRetriever", |
30 | | - "requester": { |
31 | | - "type": "HttpRequester", |
32 | | - "url_base": "https://api.test.com", |
33 | | - "path": "/users", |
34 | | - "http_method": "GET", |
35 | | - "authenticator": { |
36 | | - "type": "ApiKeyAuthenticator", |
37 | | - "header": "apikey", |
38 | | - "api_token": "{{ config['api_key'] }}", |
39 | | - }, |
40 | | - }, |
41 | | - "record_selector": { |
42 | | - "type": "RecordSelector", |
43 | | - "extractor": {"type": "DpathExtractor", "field_path": []}, |
44 | | - }, |
45 | | - "paginator": {"type": "NoPagination"}, |
46 | | - }, |
47 | | - "schema_loader": { |
48 | | - "type": "InferredSchemaLoader", |
49 | | - "retriever": { |
50 | | - "type": "SimpleRetriever", |
51 | | - "requester": { |
52 | | - "type": "HttpRequester", |
53 | | - "url_base": "https://api.test.com", |
54 | | - "path": "/users", |
55 | | - "http_method": "GET", |
56 | | - "authenticator": { |
57 | | - "type": "ApiKeyAuthenticator", |
58 | | - "header": "apikey", |
59 | | - "api_token": "{{ config['api_key'] }}", |
60 | | - }, |
61 | | - }, |
62 | | - "record_selector": { |
63 | | - "type": "RecordSelector", |
64 | | - "extractor": {"type": "DpathExtractor", "field_path": []}, |
65 | | - }, |
66 | | - "paginator": {"type": "NoPagination"}, |
67 | | - }, |
68 | | - "record_sample_size": 3, |
69 | | - }, |
70 | | - }, |
71 | | - }, |
72 | | - "streams": [ |
73 | | - "#/definitions/users_stream", |
74 | | - ], |
75 | | - "check": {"stream_names": ["users"]}, |
76 | | -} |
77 | 10 |
|
78 | 11 |
|
79 | 12 | @pytest.fixture |
|
0 commit comments