results from gradle format on master (#13053)
This commit is contained in:
@@ -11,11 +11,7 @@ MAIN_REQUIREMENTS = [
|
||||
"requests~=2.25",
|
||||
]
|
||||
|
||||
TEST_REQUIREMENTS = [
|
||||
"pytest~=6.1",
|
||||
"pytest-mock~=3.6",
|
||||
"requests_mock~=1.8"
|
||||
]
|
||||
TEST_REQUIREMENTS = ["pytest~=6.1", "pytest-mock~=3.6", "requests_mock~=1.8"]
|
||||
|
||||
setup(
|
||||
name="source_pipedrive",
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#
|
||||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
|
||||
#
|
||||
|
||||
import pendulum
|
||||
import pytest
|
||||
|
||||
@@ -11,33 +15,22 @@ def config_oauth():
|
||||
"auth_type": "Client",
|
||||
"client_id": "6779ef20e75817b79602",
|
||||
"client_secret": "7607999ef26581e81726777b7b79f20e70e75602",
|
||||
"refresh_token": "RjY2NjM5NzA2OWJjuE7c"
|
||||
"refresh_token": "RjY2NjM5NzA2OWJjuE7c",
|
||||
},
|
||||
"replication_start_date": replication_start_date
|
||||
"replication_start_date": replication_start_date,
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(name="config_token")
|
||||
def config_token():
|
||||
return {
|
||||
"authorization": {
|
||||
"auth_type": "Token",
|
||||
"api_token": "jBzsujyut9x0nzXB8vhGl"
|
||||
},
|
||||
"replication_start_date": replication_start_date
|
||||
}
|
||||
return {"authorization": {"auth_type": "Token", "api_token": "jBzsujyut9x0nzXB8vhGl"}, "replication_start_date": replication_start_date}
|
||||
|
||||
|
||||
@pytest.fixture(name="config_incremental")
|
||||
def config_incremental():
|
||||
return {
|
||||
"authenticator": {"api_token": "jBzsujyut9x0nzXB8vhGl"},
|
||||
"replication_start_date": pendulum.parse(replication_start_date)
|
||||
}
|
||||
return {"authenticator": {"api_token": "jBzsujyut9x0nzXB8vhGl"}, "replication_start_date": pendulum.parse(replication_start_date)}
|
||||
|
||||
|
||||
@pytest.fixture(name="config_refresh")
|
||||
def config_refresh():
|
||||
return {
|
||||
"authenticator": {"api_token": "jBzsujyut9x0nzXB8vhGl"}
|
||||
}
|
||||
return {"authenticator": {"api_token": "jBzsujyut9x0nzXB8vhGl"}}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#
|
||||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
|
||||
#
|
||||
|
||||
from airbyte_cdk.logger import AirbyteLogger
|
||||
from airbyte_cdk.models import (
|
||||
ConnectorSpecification,
|
||||
AirbyteStream,
|
||||
ConfiguredAirbyteCatalog,
|
||||
ConfiguredAirbyteStream,
|
||||
AirbyteStream,
|
||||
ConnectorSpecification,
|
||||
DestinationSyncMode,
|
||||
SyncMode,
|
||||
DestinationSyncMode
|
||||
)
|
||||
|
||||
from source_pipedrive.source import SourcePipedrive
|
||||
|
||||
logger = AirbyteLogger()
|
||||
@@ -16,15 +19,7 @@ PIPEDRIVE_URL_BASE = "https://api.pipedrive.com/v1/"
|
||||
|
||||
|
||||
def test_check_connection(requests_mock, config_token):
|
||||
body = {
|
||||
"success": "true",
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"update_time": "2020-10-14T11:30:36.551Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
body = {"success": "true", "data": [{"id": 1, "update_time": "2020-10-14T11:30:36.551Z"}]}
|
||||
response = setup_response(200, body)
|
||||
api_token = config_token["authorization"]["api_token"]
|
||||
requests_mock.register_uri("GET", PIPEDRIVE_URL_BASE + "deals?limit=50&api_token=" + api_token, response)
|
||||
@@ -71,10 +66,7 @@ def test_streams(config_token):
|
||||
|
||||
def setup_response(status, body):
|
||||
return [
|
||||
{
|
||||
"json": body,
|
||||
"status_code": status
|
||||
},
|
||||
{"json": body, "status_code": status},
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
#
|
||||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
|
||||
#
|
||||
|
||||
import pytest
|
||||
from airbyte_cdk.models import SyncMode
|
||||
|
||||
from source_pipedrive.streams import (
|
||||
PipedriveStream,
|
||||
ActivityFields,
|
||||
Leads,
|
||||
Activities,
|
||||
ActivityFields,
|
||||
DealFields,
|
||||
Deals,
|
||||
Leads,
|
||||
OrganizationFields,
|
||||
Organizations,
|
||||
PersonFields,
|
||||
Persons,
|
||||
PipedriveStream,
|
||||
Pipelines,
|
||||
Stages,
|
||||
DealFields,
|
||||
OrganizationFields,
|
||||
PersonFields
|
||||
)
|
||||
|
||||
PIPEDRIVE_URL_BASE = "https://api.pipedrive.com/v1/"
|
||||
@@ -51,21 +54,12 @@ def test_path_refresh(config_refresh):
|
||||
(OrganizationFields, "organizationFields"),
|
||||
(PersonFields, "personFields"),
|
||||
(Leads, "leads"),
|
||||
]
|
||||
],
|
||||
)
|
||||
def test_streams_full_refresh(stream, endpoint, requests_mock, config_refresh):
|
||||
body = {
|
||||
"success": "true",
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"update_time": "2020-10-14T11:30:36.551Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"update_time": "2020-10-14T11:30:36.551Z"
|
||||
}
|
||||
]
|
||||
"data": [{"id": 1, "update_time": "2020-10-14T11:30:36.551Z"}, {"id": 2, "update_time": "2020-10-14T11:30:36.551Z"}],
|
||||
}
|
||||
|
||||
response = setup_response(200, body)
|
||||
@@ -89,21 +83,12 @@ def test_streams_full_refresh(stream, endpoint, requests_mock, config_refresh):
|
||||
Pipelines,
|
||||
Stages,
|
||||
# Users
|
||||
]
|
||||
],
|
||||
)
|
||||
def test_streams_incremental_sync(stream, requests_mock, config_incremental):
|
||||
body = {
|
||||
"success": "true",
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"update_time": "2020-10-14T11:30:36.551Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"update_time": "2020-11-14T11:30:36.551Z"
|
||||
}
|
||||
]
|
||||
"data": [{"id": 1, "update_time": "2020-10-14T11:30:36.551Z"}, {"id": 2, "update_time": "2020-11-14T11:30:36.551Z"}],
|
||||
}
|
||||
|
||||
response = setup_response(200, body)
|
||||
@@ -123,8 +108,5 @@ def test_streams_incremental_sync(stream, requests_mock, config_incremental):
|
||||
|
||||
def setup_response(status, body):
|
||||
return [
|
||||
{
|
||||
"json": body,
|
||||
"status_code": status
|
||||
},
|
||||
{"json": body, "status_code": status},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user