-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
conftest.py
87 lines (67 loc) · 2.52 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import pytest
from source_hubspot.source import SourceHubspot
from source_hubspot.streams import API
NUMBER_OF_PROPERTIES = 2000
@pytest.fixture(name="oauth_config")
def oauth_config_fixture():
return {
"start_date": "2021-10-10T00:00:00Z",
"credentials": {
"credentials_title": "OAuth Credentials",
"redirect_uri": "https://airbyte.io",
"client_id": "test_client_id",
"client_secret": "test_client_secret",
"refresh_token": "test_refresh_token",
"access_token": "test_access_token",
"token_expires": "2021-05-30T06:00:00Z",
},
}
@pytest.fixture(name="common_params")
def common_params_fixture(config):
source = SourceHubspot()
common_params = source.get_common_params(config=config)
return common_params
@pytest.fixture(name="config_invalid_client_id")
def config_invalid_client_id_fixture():
return {
"start_date": "2021-01-10T00:00:00Z",
"credentials": {
"credentials_title": "OAuth Credentials",
"client_id": "invalid_client_id",
"client_secret": "invalid_client_secret",
"access_token": "test_access_token",
"refresh_token": "test_refresh_token",
},
}
@pytest.fixture(name="config")
def config_fixture():
return {
"start_date": "2021-01-10T00:00:00Z",
"credentials": {"credentials_title": "Private App Credentials", "access_token": "test_access_token"},
"enable_experimental_streams": False
}
@pytest.fixture(name="config_experimental")
def config_eperimantal_fixture():
return {
"start_date": "2021-01-10T00:00:00Z",
"credentials": {"credentials_title": "Private App Credentials", "access_token": "test_access_token"},
"enable_experimental_streams": True
}
@pytest.fixture(name="config_invalid_date")
def config_invalid_date_fixture():
return {
"start_date": "2000-00-00T00:00:00Z",
"credentials": {"credentials_title": "Private App Credentials", "access_token": "test_access_token"},
}
@pytest.fixture(name="some_credentials")
def some_credentials_fixture():
return {"credentials_title": "Private App Credentials", "access_token": "wrong token"}
@pytest.fixture(name="fake_properties_list")
def fake_properties_list():
return [f"property_number_{i}" for i in range(NUMBER_OF_PROPERTIES)]
@pytest.fixture(name="api")
def api(some_credentials):
return API(some_credentials)