From 05ce3dcff03dacc772f75c88e79354b3bbf30e6b Mon Sep 17 00:00:00 2001 From: Topher Lubaway Date: Fri, 20 May 2022 08:14:34 -0500 Subject: [PATCH] results from gradle format on master (#13053) --- .../destination_google_sheets/spec.json | 4 +- .../integration_tests/configured_catalog.json | 86 +- .../sample_config_oauth.json | 14 +- .../test_data/test_buffer_catalog.json | 66 +- .../test_data/test_writer_catalog.json | 32 +- .../source_amazon_seller_partner/__init__.py | 3 +- .../unit_tests/test_source.py | 17 +- .../google_sheets_source/spec.yaml | 2 +- .../source_linkedin_ads/spec.json | 2 +- .../source-notion/unit_tests/test_streams.py | 8 +- .../connectors/source-pipedrive/setup.py | 6 +- .../source-pipedrive/unit_tests/conftest.py | 25 +- .../unit_tests/test_source.py | 26 +- .../unit_tests/test_streams.py | 48 +- .../source_salesforce/schemas/Describe.json | 758 +++++------ .../source_scaffold_source_http/spec.yaml | 2 +- .../integration_tests/spec.json | 8 +- .../streams_audience_incremental.json | 3 +- .../source-twilio/source_twilio/streams.py | 4 +- .../connectors/source-typeform/setup.py | 7 +- .../source-typeform/unit_tests/conftest.py | 1126 ++++++----------- .../source-typeform/unit_tests/test_source.py | 5 +- .../unit_tests/test_streams.py | 10 +- 23 files changed, 961 insertions(+), 1301 deletions(-) diff --git a/airbyte-integrations/connectors/destination-google-sheets/destination_google_sheets/spec.json b/airbyte-integrations/connectors/destination-google-sheets/destination_google_sheets/spec.json index cdfa07c129cb5..b550760c58ca5 100644 --- a/airbyte-integrations/connectors/destination-google-sheets/destination_google_sheets/spec.json +++ b/airbyte-integrations/connectors/destination-google-sheets/destination_google_sheets/spec.json @@ -15,7 +15,9 @@ "type": "string", "title": "Spreadsheet Link", "description": "The link to your spreadsheet. See this guide for more details.", - "examples": ["https://docs.google.com/spreadsheets/d/1hLd9Qqti3UyLXZB2aFfUWDT7BG/edit"] + "examples": [ + "https://docs.google.com/spreadsheets/d/1hLd9Qqti3UyLXZB2aFfUWDT7BG/edit" + ] }, "credentials": { "type": "object", diff --git a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/configured_catalog.json index 4687514bb47f6..2514976e9b6b2 100644 --- a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/configured_catalog.json @@ -7,44 +7,48 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "id": { - "type": ["null", "string"] - }, - "str": { + "id": { + "type": ["null", "string"] + }, + "str": { + "type": ["null", "string"] + }, + "num": { + "type": ["null", "number"] + }, + "list": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } + }, + "dict": { + "type": ["null", "object"], + "properties": { + "type": ["null", "string"] + } + }, + "double_list": { + "type": ["null", "array"], + "items": { + "type": ["null", "array"], + "items": { "type": ["null", "string"] - }, - "num": { - "type": ["null", "number"] - }, - "list": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - }, - "dict": { - "type": ["null", "object"], - "properties": { - "type": ["null", "string"] - } - }, - "double_list": { - "type": ["null", "array"], - "items": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - } } + } + } } }, "supported_sync_modes": ["full_refresh"], - "supported_destination_sync_modes": ["overwrite", "append", "append_dedup"] + "supported_destination_sync_modes": [ + "overwrite", + "append", + "append_dedup" + ] }, "sync_mode": "full_refresh", "destination_sync_mode": "append_dedup", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] }, { "stream": { @@ -78,19 +82,23 @@ "type": ["null", "array"], "items": { "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } + "items": { + "type": ["null", "string"] + } } } } }, "supported_sync_modes": ["full_refresh"], - "supported_destination_sync_modes": ["overwrite", "append", "append_dedup"] + "supported_destination_sync_modes": [ + "overwrite", + "append", + "append_dedup" + ] }, "sync_mode": "full_refresh", "destination_sync_mode": "append", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] }, { "stream": { @@ -124,9 +132,9 @@ "type": ["null", "array"], "items": { "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } + "items": { + "type": ["null", "string"] + } } } } @@ -136,7 +144,7 @@ }, "sync_mode": "full_refresh", "destination_sync_mode": "overwrite", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] } ] } diff --git a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/sample_config_oauth.json b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/sample_config_oauth.json index 055843049889e..029a8a0f199a8 100644 --- a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/sample_config_oauth.json +++ b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/sample_config_oauth.json @@ -1,8 +1,8 @@ { - "spreadsheet_id": "https://docs.google.com/spreadsheets/d//edit#gid=0", - "credentials": { - "client_id": "YOUR_OAUTH_CLIENT_ID", - "client_secret": "YOUR_OAUTH_CLIENT_SECRET", - "refresh_token": "YOUR_REFRESH_TOKEN" - } -} \ No newline at end of file + "spreadsheet_id": "https://docs.google.com/spreadsheets/d//edit#gid=0", + "credentials": { + "client_id": "YOUR_OAUTH_CLIENT_ID", + "client_secret": "YOUR_OAUTH_CLIENT_SECRET", + "refresh_token": "YOUR_REFRESH_TOKEN" + } +} diff --git a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_buffer_catalog.json b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_buffer_catalog.json index 9477cc66ee959..def4f1900e431 100644 --- a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_buffer_catalog.json +++ b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_buffer_catalog.json @@ -7,26 +7,30 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "id": { - "type": ["null", "string"] - }, - "key1": { - "type": ["null", "numeric"] - }, - "list": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - } + "id": { + "type": ["null", "string"] + }, + "key1": { + "type": ["null", "numeric"] + }, + "list": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } + } } }, "supported_sync_modes": ["full_refresh"], - "supported_destination_sync_modes": ["overwrite", "append", "append_dedup"] + "supported_destination_sync_modes": [ + "overwrite", + "append", + "append_dedup" + ] }, "sync_mode": "full_refresh", "destination_sync_mode": "append_dedup", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] }, { "stream": { @@ -35,26 +39,30 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "id": { - "type": ["null", "string"] - }, - "key1": { - "type": ["null", "numeric"] - }, - "list": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - } + "id": { + "type": ["null", "string"] + }, + "key1": { + "type": ["null", "numeric"] + }, + "list": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } + } } }, "supported_sync_modes": ["full_refresh"], - "supported_destination_sync_modes": ["overwrite", "append", "append_dedup"] + "supported_destination_sync_modes": [ + "overwrite", + "append", + "append_dedup" + ] }, "sync_mode": "full_refresh", "destination_sync_mode": "append", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] }, { "stream": { @@ -82,7 +90,7 @@ }, "sync_mode": "full_refresh", "destination_sync_mode": "overwrite", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] } ] } diff --git a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_writer_catalog.json b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_writer_catalog.json index c0ca2263cf6f6..02904370ced40 100644 --- a/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_writer_catalog.json +++ b/airbyte-integrations/connectors/destination-google-sheets/integration_tests/test_data/test_writer_catalog.json @@ -7,26 +7,30 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "id": { - "type": ["null", "string"] - }, - "key1": { - "type": ["null", "numeric"] - }, - "list": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - } + "id": { + "type": ["null", "string"] + }, + "key1": { + "type": ["null", "numeric"] + }, + "list": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } + } } }, "supported_sync_modes": ["full_refresh"], - "supported_destination_sync_modes": ["overwrite", "append", "append_dedup"] + "supported_destination_sync_modes": [ + "overwrite", + "append", + "append_dedup" + ] }, "sync_mode": "full_refresh", "destination_sync_mode": "append_dedup", - "primary_key": [ [ "id" ] ] + "primary_key": [["id"]] } ] } diff --git a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/__init__.py b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/__init__.py index 7afe659e747d6..9e5612c5cda13 100644 --- a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/__init__.py +++ b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/__init__.py @@ -21,7 +21,6 @@ # SOFTWARE. -from .source import SourceAmazonSellerPartner -from .source import ConnectorConfig +from .source import ConnectorConfig, SourceAmazonSellerPartner __all__ = ["SourceAmazonSellerPartner", "ConnectorConfig"] diff --git a/airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py b/airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py index 578a18057bd51..ca2690c7e4a7b 100644 --- a/airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py +++ b/airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py @@ -1,9 +1,13 @@ +# +# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# + +from unittest.mock import MagicMock + import pytest -from source_amazon_seller_partner import SourceAmazonSellerPartner -from source_amazon_seller_partner import ConnectorConfig from airbyte_cdk.models import ConnectorSpecification from airbyte_cdk.sources.streams import Stream -from unittest.mock import MagicMock +from source_amazon_seller_partner import ConnectorConfig, SourceAmazonSellerPartner from source_amazon_seller_partner.source import boto3 @@ -23,7 +27,7 @@ def connector_config(): aws_secret_key="aws_secret_key", role_arn="arn:aws:iam::123456789098:role/some-role", aws_environment="SANDBOX", - region="US" + region="US", ) @@ -56,10 +60,7 @@ def test_streams(connector_source, connector_config, mock_boto_client): assert isinstance(stream, Stream) -@pytest.mark.parametrize( - "arn", - ("arn:aws:iam::123456789098:user/some-user", "arn:aws:iam::123456789098:role/some-role") -) +@pytest.mark.parametrize("arn", ("arn:aws:iam::123456789098:user/some-user", "arn:aws:iam::123456789098:role/some-role")) def test_stream_with_good_iam_arn_value(mock_boto_client, connector_source, connector_config, arn): connector_config.role_arn = arn result = connector_source.get_sts_credentials(connector_config) diff --git a/airbyte-integrations/connectors/source-google-sheets/google_sheets_source/spec.yaml b/airbyte-integrations/connectors/source-google-sheets/google_sheets_source/spec.yaml index 59c3ea2e094eb..d9d07327a70b4 100644 --- a/airbyte-integrations/connectors/source-google-sheets/google_sheets_source/spec.yaml +++ b/airbyte-integrations/connectors/source-google-sheets/google_sheets_source/spec.yaml @@ -69,7 +69,7 @@ connectionSpecification: Guide for more details airbyte_secret: true examples: - - "{ \"type\": \"service_account\", \"project_id\": YOUR_PROJECT_ID, \"private_key_id\": YOUR_PRIVATE_KEY, ... }" + - '{ "type": "service_account", "project_id": YOUR_PROJECT_ID, "private_key_id": YOUR_PRIVATE_KEY, ... }' authSpecification: auth_type: oauth2.0 oauth2Specification: diff --git a/airbyte-integrations/connectors/source-linkedin-ads/source_linkedin_ads/spec.json b/airbyte-integrations/connectors/source-linkedin-ads/source_linkedin_ads/spec.json index 06099e9e483a5..688ab0f3f41cc 100644 --- a/airbyte-integrations/connectors/source-linkedin-ads/source_linkedin_ads/spec.json +++ b/airbyte-integrations/connectors/source-linkedin-ads/source_linkedin_ads/spec.json @@ -74,7 +74,7 @@ "type": "integer" }, "default": [] - } + } } }, "authSpecification": { diff --git a/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py index c597f82e051ab..6cdb0a4c5fd14 100644 --- a/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-notion/unit_tests/test_streams.py @@ -2,8 +2,8 @@ # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # -from http import HTTPStatus import random +from http import HTTPStatus from unittest.mock import MagicMock import pytest @@ -104,7 +104,7 @@ def test_user_stream_handles_pagination_correclty(requests_mock): "results": [{"id": f"{x}", "object": "user", "type": ["person", "bot"][random.randint(0, 1)]} for x in range(100)], "next_cursor": "bc48234b-77b2-41a6-95a3-6a8abb7887d5", "has_more": True, - "type": "user" + "type": "user", } requests_mock.get("https://api.notion.com/v1/users?page_size=100", json=response_body) @@ -113,7 +113,7 @@ def test_user_stream_handles_pagination_correclty(requests_mock): "results": [{"id": f"{x}", "object": "user", "type": ["person", "bot"][random.randint(0, 1)]} for x in range(100, 200)], "next_cursor": "67030467-b97b-4729-8fd6-2fb33d012da4", "has_more": True, - "type": "user" + "type": "user", } requests_mock.get("https://api.notion.com/v1/users?page_size=100&start_cursor=bc48234b-77b2-41a6-95a3-6a8abb7887d5", json=response_body) @@ -122,7 +122,7 @@ def test_user_stream_handles_pagination_correclty(requests_mock): "results": [{"id": f"{x}", "object": "user", "type": ["person", "bot"][random.randint(0, 1)]} for x in range(200, 220)], "next_cursor": None, "has_more": False, - "type": "user" + "type": "user", } requests_mock.get("https://api.notion.com/v1/users?page_size=100&start_cursor=67030467-b97b-4729-8fd6-2fb33d012da4", json=response_body) diff --git a/airbyte-integrations/connectors/source-pipedrive/setup.py b/airbyte-integrations/connectors/source-pipedrive/setup.py index 5681f6720d931..411f684a2da99 100644 --- a/airbyte-integrations/connectors/source-pipedrive/setup.py +++ b/airbyte-integrations/connectors/source-pipedrive/setup.py @@ -11,11 +11,7 @@ "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", diff --git a/airbyte-integrations/connectors/source-pipedrive/unit_tests/conftest.py b/airbyte-integrations/connectors/source-pipedrive/unit_tests/conftest.py index 34506a2615d3a..4e8503f3332d2 100644 --- a/airbyte-integrations/connectors/source-pipedrive/unit_tests/conftest.py +++ b/airbyte-integrations/connectors/source-pipedrive/unit_tests/conftest.py @@ -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"}} diff --git a/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_source.py b/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_source.py index 7f30ced6efdb4..f9b9c66a257f1 100644 --- a/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_source.py +++ b/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_source.py @@ -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 @@ 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}, ] diff --git a/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_streams.py index 996d887738444..d20c0a38095fe 100644 --- a/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-pipedrive/unit_tests/test_streams.py @@ -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}, ] diff --git a/airbyte-integrations/connectors/source-salesforce/source_salesforce/schemas/Describe.json b/airbyte-integrations/connectors/source-salesforce/source_salesforce/schemas/Describe.json index be5c2767b6e1d..9d333a756e273 100644 --- a/airbyte-integrations/connectors/source-salesforce/source_salesforce/schemas/Describe.json +++ b/airbyte-integrations/connectors/source-salesforce/source_salesforce/schemas/Describe.json @@ -1,400 +1,400 @@ { - "type": "object", - "properties": { - "actionOverrides": { - "type": ["null", "array"], - "items": { - "type": ["null", "object"], - "properties": { - "formFactor": { - "type": ["null", "string"] - }, - "isAvailableInTouch": { - "type": ["null", "boolean"] - }, - "name": { - "type": ["null", "string"] - }, - "pageId": { - "type": ["null", "string"] - }, - "url": { - "type": ["null", "string"] - } - } + "type": "object", + "properties": { + "actionOverrides": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "formFactor": { + "type": ["null", "string"] + }, + "isAvailableInTouch": { + "type": ["null", "boolean"] + }, + "name": { + "type": ["null", "string"] + }, + "pageId": { + "type": ["null", "string"] + }, + "url": { + "type": ["null", "string"] + } } - }, - "activateable": { - "type": ["null", "boolean"] - }, - "associateEntityType": { - "type": ["null", "string"] - }, - "associateParentEntity": { - "type": ["null", "string"] - }, - "childRelationships": { - "type": ["null", "array"], - "items": { - "type": ["null", "object"], - "properties": { - "cascadeDelete": { - "type": ["null", "boolean"] - }, - "childSObject": { - "type": "string" - }, - "deprecatedAndHidden": { - "type": ["null", "boolean"] - }, - "field": { - "type": ["null", "string"] - }, - "junctionIdListNames": { - "type": "array", - "items": { - "type": ["null", "string"] - } - }, - "junctionReferenceTo": { - "type": "array", - "items": { - "type": ["null", "string"] - } - }, - "relationshipName": { - "type": ["null", "string"] - }, - "restrictedDelete": { - "type": ["null", "boolean"] - } + } + }, + "activateable": { + "type": ["null", "boolean"] + }, + "associateEntityType": { + "type": ["null", "string"] + }, + "associateParentEntity": { + "type": ["null", "string"] + }, + "childRelationships": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "cascadeDelete": { + "type": ["null", "boolean"] + }, + "childSObject": { + "type": "string" + }, + "deprecatedAndHidden": { + "type": ["null", "boolean"] + }, + "field": { + "type": ["null", "string"] + }, + "junctionIdListNames": { + "type": "array", + "items": { + "type": ["null", "string"] + } + }, + "junctionReferenceTo": { + "type": "array", + "items": { + "type": ["null", "string"] } + }, + "relationshipName": { + "type": ["null", "string"] + }, + "restrictedDelete": { + "type": ["null", "boolean"] + } } - }, - "compactLayoutable": { - "type": ["null", "boolean"] - }, - "createable": { - "type": ["null", "boolean"] - }, - "custom": { - "type": ["null", "boolean"] - }, - "customSetting": { - "type": ["null", "boolean"] - }, - "dataTranslationEnabled": { - "type": ["null", "boolean"] - }, - "deepCloneable": { - "type": ["null", "boolean"] - }, - "defaultImplementation": { - "type": ["null", "string"] - }, - "deletable": { - "type": ["null", "boolean"] - }, - "deprecatedAndHidden": { - "type": ["null", "boolean"] - }, - "extendedBy": { - "type": ["null", "string"] - }, - "extendsInterfaces": { - "type": ["null", "string"] - }, - "feedEnabled": { - "type": ["null", "boolean"] - }, - "fields": { - "type": ["null", "array"], - "items": { + } + }, + "compactLayoutable": { + "type": ["null", "boolean"] + }, + "createable": { + "type": ["null", "boolean"] + }, + "custom": { + "type": ["null", "boolean"] + }, + "customSetting": { + "type": ["null", "boolean"] + }, + "dataTranslationEnabled": { + "type": ["null", "boolean"] + }, + "deepCloneable": { + "type": ["null", "boolean"] + }, + "defaultImplementation": { + "type": ["null", "string"] + }, + "deletable": { + "type": ["null", "boolean"] + }, + "deprecatedAndHidden": { + "type": ["null", "boolean"] + }, + "extendedBy": { + "type": ["null", "string"] + }, + "extendsInterfaces": { + "type": ["null", "string"] + }, + "feedEnabled": { + "type": ["null", "boolean"] + }, + "fields": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "autoNumber": { + "type": ["null", "boolean"] + }, + "byteLength": { + "type": ["null", "integer"] + }, + "calculated": { + "type": ["null", "boolean"] + }, + "caseSensitive": { + "type": ["null", "boolean"] + }, + "controllerName": { + "type": ["null", "string"] + }, + "createable": { + "type": ["null", "boolean"] + }, + "custom": { + "type": ["null", "boolean"] + }, + "dataTranslationEnabled": { + "type": ["null", "boolean"] + }, + "defaultedOnCreate": { + "type": ["null", "boolean"] + }, + "defaultValueFormula": { + "type": ["null", "string"] + }, + "dependentPicklist": { + "type": ["null", "boolean"] + }, + "deprecatedAndHidden": { + "type": ["null", "boolean"] + }, + "digits": { + "type": ["null", "integer"] + }, + "displayLocationInDecimal": { + "type": ["null", "boolean"] + }, + "encrypted": { + "type": ["null", "boolean"] + }, + "extraTypeInfo": { + "type": ["null", "string"] + }, + "filterable": { + "type": ["null", "boolean"] + }, + "filteredLookupInfo": { "type": ["null", "object"], "properties": { - "autoNumber": { - "type": ["null", "boolean"] - }, - "byteLength": { - "type": ["null", "integer"] - }, - "calculated": { - "type": ["null", "boolean"] - }, - "caseSensitive": { - "type": ["null", "boolean"] - }, - "controllerName": { - "type": ["null", "string"] - }, - "createable": { - "type": ["null", "boolean"] - }, - "custom": { - "type": ["null", "boolean"] - }, - "dataTranslationEnabled": { - "type": ["null", "boolean"] - }, - "defaultedOnCreate": { - "type": ["null", "boolean"] - }, - "defaultValueFormula": { - "type": ["null", "string"] - }, - "dependentPicklist": { - "type": ["null", "boolean"] - }, - "deprecatedAndHidden": { - "type": ["null", "boolean"] - }, - "digits": { - "type": ["null", "integer"] - }, - "displayLocationInDecimal": { - "type": ["null", "boolean"] - }, - "encrypted": { - "type": ["null", "boolean"] - }, - "extraTypeInfo": { - "type": ["null", "string"] - }, - "filterable": { - "type": ["null", "boolean"] - }, - "filteredLookupInfo": { - "type": ["null", "object"], - "properties": { - "controllingFields": { - "type": ["null", "array"], - "items": { - "type": ["null", "string"] - } - }, - "dependent": { - "type": ["null", "boolean"] - }, - "optionalFilter": { - "type": ["null", "boolean"] - } - } - }, - "formula": { - "type": ["null", "string"] - }, - "groupable": { - "type": ["null", "boolean"] - }, - "highScaleNumber": { - "type": ["null", "boolean"] - }, - "htmlFormatted": { - "type": ["null", "boolean"] - }, - "idLookup": { - "type": ["null", "boolean"] - }, - "inlineHelpText": { - "type": ["null", "string"] - }, - "label": { - "type": ["null", "string"] - }, - "length": { - "type": ["null", "integer"] - }, - "mask": { - "type": ["null", "string"] - }, - "maskType": { - "type": ["null", "string"] - }, - "name": { - "type": ["null", "string"] - }, - "nameField": { - "type": ["null", "boolean"] - }, - "namePointing": { - "type": ["null", "boolean"] - }, - "nillable": { - "type": ["null", "boolean"] - }, - "permissionable": { - "type": ["null", "boolean"] - }, - "picklistValues": { + "controllingFields": { "type": ["null", "array"], "items": { - "type": ["null", "object"], - "properties": { - "active": { - "type":["null", "boolean"] - }, - "defaultValue": { - "type": ["null", "boolean"] - }, - "label": { - "type": ["null", "string"] - }, - "validFor": { - "type": ["null", "array"], - "items": { - "type": ["null", "integer"] - } - }, - "value": { - "type": ["null", "string"] - } - } - } - }, - "polymorphicForeignKey": { - "type": ["null", "boolean"] - }, - "precision": { - "type": ["null", "integer"] - }, - "referenceTargetField": { - "type": ["null", "string"] - }, - "referenceTo": { - "type": "array", - "items": { - "type": ["null", "string"] + "type": ["null", "string"] } }, - "relationshipName": { - "type": ["null", "string"] - }, - "relationshipOrder": { - "type": ["null", "integer"] - }, - "restrictedPicklist": { + "dependent": { "type": ["null", "boolean"] }, - "scale": { - "type": ["null", "integer"] - }, - "searchPrefilterable": { - "type": ["null", "boolean"] - }, - "soapType": { - "type": ["null", "string"] - }, - "sortable": { - "type": ["null", "boolean"] - }, - "type": { - "type": ["null", "string"] - }, - "unique": { - "type": ["null", "boolean"] - }, - "updateable": { - "type": ["null", "boolean"] - }, - "writeRequiresMasterRead": { + "optionalFilter": { "type": ["null", "boolean"] } } - } - }, - "implementedBy": { - "type": ["null", "string"] - }, - "implementsInterfaces": { - "type": ["null", "string"] - }, - "isInterface": { - "type": ["null", "boolean"] - }, - "keyPrefix": { - "type": ["null", "string"] - }, - "label": { - "type": ["null", "string"] - }, - "labelPlural": { - "type": ["null", "string"] - }, - "layoutable": { - "type": ["null", "boolean"] - }, - "mergeable": { - "type": ["null", "boolean"] - }, - "mruEnabled": { - "type": ["null", "boolean"] - }, - "name": { - "type": ["null", "string"] - }, - "namedLayoutInfos": { - "type": ["null", "array"], - "items": { - "type": ["null", "object"], - "properties": { - "name": { - "type": ["null", "string"] + }, + "formula": { + "type": ["null", "string"] + }, + "groupable": { + "type": ["null", "boolean"] + }, + "highScaleNumber": { + "type": ["null", "boolean"] + }, + "htmlFormatted": { + "type": ["null", "boolean"] + }, + "idLookup": { + "type": ["null", "boolean"] + }, + "inlineHelpText": { + "type": ["null", "string"] + }, + "label": { + "type": ["null", "string"] + }, + "length": { + "type": ["null", "integer"] + }, + "mask": { + "type": ["null", "string"] + }, + "maskType": { + "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] + }, + "nameField": { + "type": ["null", "boolean"] + }, + "namePointing": { + "type": ["null", "boolean"] + }, + "nillable": { + "type": ["null", "boolean"] + }, + "permissionable": { + "type": ["null", "boolean"] + }, + "picklistValues": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "active": { + "type": ["null", "boolean"] + }, + "defaultValue": { + "type": ["null", "boolean"] + }, + "label": { + "type": ["null", "string"] + }, + "validFor": { + "type": ["null", "array"], + "items": { + "type": ["null", "integer"] + } + }, + "value": { + "type": ["null", "string"] } - } - } - }, - "networkScopeFieldName": { - "type": ["null", "string"] - }, - "queryable": { - "type": ["null", "boolean"] - }, - "recordTypeInfos": { - "type": ["null", "array"] - }, - "replicateable": { - "type": ["null", "boolean"] - }, - "retrieveable": { - "type": ["null", "boolean"] - }, - "searchable": { - "type": ["null", "boolean"] - }, - "searchLayoutable": { - "type": ["null", "boolean"] - }, - "supportedScopes": { - "type": ["null", "array"], - "items": { - "type": ["null", "object"], - "properties": { - "label": { - "type": ["null", "string"] - }, - "name": { - "type": ["null", "string"] } } + }, + "polymorphicForeignKey": { + "type": ["null", "boolean"] + }, + "precision": { + "type": ["null", "integer"] + }, + "referenceTargetField": { + "type": ["null", "string"] + }, + "referenceTo": { + "type": "array", + "items": { + "type": ["null", "string"] + } + }, + "relationshipName": { + "type": ["null", "string"] + }, + "relationshipOrder": { + "type": ["null", "integer"] + }, + "restrictedPicklist": { + "type": ["null", "boolean"] + }, + "scale": { + "type": ["null", "integer"] + }, + "searchPrefilterable": { + "type": ["null", "boolean"] + }, + "soapType": { + "type": ["null", "string"] + }, + "sortable": { + "type": ["null", "boolean"] + }, + "type": { + "type": ["null", "string"] + }, + "unique": { + "type": ["null", "boolean"] + }, + "updateable": { + "type": ["null", "boolean"] + }, + "writeRequiresMasterRead": { + "type": ["null", "boolean"] + } + } + } + }, + "implementedBy": { + "type": ["null", "string"] + }, + "implementsInterfaces": { + "type": ["null", "string"] + }, + "isInterface": { + "type": ["null", "boolean"] + }, + "keyPrefix": { + "type": ["null", "string"] + }, + "label": { + "type": ["null", "string"] + }, + "labelPlural": { + "type": ["null", "string"] + }, + "layoutable": { + "type": ["null", "boolean"] + }, + "mergeable": { + "type": ["null", "boolean"] + }, + "mruEnabled": { + "type": ["null", "boolean"] + }, + "name": { + "type": ["null", "string"] + }, + "namedLayoutInfos": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "name": { + "type": ["null", "string"] + } + } + } + }, + "networkScopeFieldName": { + "type": ["null", "string"] + }, + "queryable": { + "type": ["null", "boolean"] + }, + "recordTypeInfos": { + "type": ["null", "array"] + }, + "replicateable": { + "type": ["null", "boolean"] + }, + "retrieveable": { + "type": ["null", "boolean"] + }, + "searchable": { + "type": ["null", "boolean"] + }, + "searchLayoutable": { + "type": ["null", "boolean"] + }, + "supportedScopes": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "label": { + "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] + } } - }, - "triggerable": { - "type": ["null", "boolean"] - }, - "undeletable": { - "type": ["null", "boolean"] - }, - "updateable": { - "type": ["null", "boolean"] - }, - "urlDetail": { - "type": ["null", "string"] - }, - "urlEdit": { - "type": ["null", "string"] - }, - "urlNew": { - "type": ["null", "string"] } + }, + "triggerable": { + "type": ["null", "boolean"] + }, + "undeletable": { + "type": ["null", "boolean"] + }, + "updateable": { + "type": ["null", "boolean"] + }, + "urlDetail": { + "type": ["null", "string"] + }, + "urlEdit": { + "type": ["null", "string"] + }, + "urlNew": { + "type": ["null", "string"] } - } \ No newline at end of file + } +} diff --git a/airbyte-integrations/connectors/source-scaffold-source-http/source_scaffold_source_http/spec.yaml b/airbyte-integrations/connectors/source-scaffold-source-http/source_scaffold_source_http/spec.yaml index f1c28b63d2925..99ff36cb6842f 100644 --- a/airbyte-integrations/connectors/source-scaffold-source-http/source_scaffold_source_http/spec.yaml +++ b/airbyte-integrations/connectors/source-scaffold-source-http/source_scaffold_source_http/spec.yaml @@ -7,7 +7,7 @@ connectionSpecification: - TODO additionalProperties: false properties: - # 'TODO: This schema defines the configuration required for the source. This usually involves metadata such as database and/or authentication information.': + # 'TODO: This schema defines the configuration required for the source. This usually involves metadata such as database and/or authentication information.': TODO: type: string description: describe me diff --git a/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/spec.json b/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/spec.json index ae883d06dae29..3d64135e65252 100644 --- a/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/spec.json +++ b/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/spec.json @@ -11,8 +11,8 @@ "default": {}, "order": 0, "type": "object", - "oneOf": [{ - + "oneOf": [ + { "title": "OAuth2.0", "type": "object", "properties": { @@ -42,8 +42,8 @@ } }, "required": ["app_id", "secret", "access_token"] - }, { - + }, + { "title": "Sandbox Access Token", "type": "object", "properties": { diff --git a/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/streams_audience_incremental.json b/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/streams_audience_incremental.json index 92d2b3d4514ac..b2367b2a88413 100644 --- a/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/streams_audience_incremental.json +++ b/airbyte-integrations/connectors/source-tiktok-marketing/integration_tests/streams_audience_incremental.json @@ -2,7 +2,6 @@ "streams": [ { "stream": { - "name": "ad_group_audience_reports", "json_schema": {}, "supported_sync_modes": ["full_refresh", "incremental"], @@ -35,4 +34,4 @@ "destination_sync_mode": "append" } ] -} \ No newline at end of file +} diff --git a/airbyte-integrations/connectors/source-twilio/source_twilio/streams.py b/airbyte-integrations/connectors/source-twilio/source_twilio/streams.py index f47468af4f266..f021ed32d21aa 100644 --- a/airbyte-integrations/connectors/source-twilio/source_twilio/streams.py +++ b/airbyte-integrations/connectors/source-twilio/source_twilio/streams.py @@ -56,7 +56,7 @@ def parse_response(self, response: requests.Response, stream_state: Mapping[str, record.pop(field, None) yield record yield from records - + def backoff_time(self, response: requests.Response) -> Optional[float]: """This method is called if we run into the rate limit. Twilio puts the retry time in the `Retry-After` response header so we @@ -66,7 +66,7 @@ def backoff_time(self, response: requests.Response) -> Optional[float]: backoff_time = response.headers.get("Retry-After") if backoff_time is not None: - return float(backoff_time) + return float(backoff_time) def request_params( self, stream_state: Mapping[str, Any], next_page_token: Mapping[str, Any] = None, **kwargs diff --git a/airbyte-integrations/connectors/source-typeform/setup.py b/airbyte-integrations/connectors/source-typeform/setup.py index 6aa2be8ba3a59..dea9eed586391 100644 --- a/airbyte-integrations/connectors/source-typeform/setup.py +++ b/airbyte-integrations/connectors/source-typeform/setup.py @@ -9,12 +9,7 @@ "airbyte-cdk", ] -TEST_REQUIREMENTS = [ - "pytest~=6.1", - "source-acceptance-test", - "pytest-mock~=3.6", - "requests_mock~=1.8" -] +TEST_REQUIREMENTS = ["pytest~=6.1", "source-acceptance-test", "pytest-mock~=3.6", "requests_mock~=1.8"] setup( name="source_typeform", diff --git a/airbyte-integrations/connectors/source-typeform/unit_tests/conftest.py b/airbyte-integrations/connectors/source-typeform/unit_tests/conftest.py index 2181f6dcf530f..1e0067b86e662 100644 --- a/airbyte-integrations/connectors/source-typeform/unit_tests/conftest.py +++ b/airbyte-integrations/connectors/source-typeform/unit_tests/conftest.py @@ -1,767 +1,446 @@ +# +# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# + import pytest @pytest.fixture def config(): - return { - "start_date": "2020-01-01T00:00:00Z", - "token": "7607999ef26581e81726777b7b79f20e70e75602", - "form_ids": ["u6nXL7", "k9xNV4"] - } + return {"start_date": "2020-01-01T00:00:00Z", "token": "7607999ef26581e81726777b7b79f20e70e75602", "form_ids": ["u6nXL7", "k9xNV4"]} @pytest.fixture def config_without_forms(): - return { - "start_date": "2020-01-01T00:00:00Z", - "token": "7607999ef26581e81726777b7b79f20e70e75602" - } + return {"start_date": "2020-01-01T00:00:00Z", "token": "7607999ef26581e81726777b7b79f20e70e75602"} @pytest.fixture def form_response(): - return setup_response(200, { - "id": "id", - "title": "title", - "language": "en", - "fields": [ - {} - ], - "hidden": [ - "string" - ], - "variables": { - "score": 0, - "price": 0 - }, - "welcome_screens": [ - { - "ref": "nice-readable-welcome-ref", - "title": "Welcome Title", - "properties": { - "description": "Cool description for the welcome", - "show_button": True, - "button_text": "start" - }, - "attachment": { - "type": "image", - "href": { - "image": { - "value": "https://images.typeform.com/images/4bcd3" - }, - "Pexels": { - "value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011" - }, - "Vimeo": { - "value": "https://vimeo.com/245714980" - }, - "YouTube": { - "value": "https://www.youtube.com/watch?v=cGk3tZIIpXE" - } - }, - "scale": 0, - "properties": { - "description": "description" - } - }, - "layout": { - "type": "float", - "placement": "left", + return setup_response( + 200, + { + "id": "id", + "title": "title", + "language": "en", + "fields": [{}], + "hidden": ["string"], + "variables": {"score": 0, "price": 0}, + "welcome_screens": [ + { + "ref": "nice-readable-welcome-ref", + "title": "Welcome Title", + "properties": {"description": "Cool description for the welcome", "show_button": True, "button_text": "start"}, "attachment": { "type": "image", "href": { - "image": { - "value": "https://images.typeform.com/images/4bcd3" - }, - "Pexels": { - "value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011" - }, - "Vimeo": { - "value": "https://vimeo.com/245714980" - }, - "YouTube": { - "value": "https://www.youtube.com/watch?v=cGk3tZIIpXE" - } + "image": {"value": "https://images.typeform.com/images/4bcd3"}, + "Pexels": {"value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011"}, + "Vimeo": {"value": "https://vimeo.com/245714980"}, + "YouTube": {"value": "https://www.youtube.com/watch?v=cGk3tZIIpXE"}, }, "scale": 0, - "properties": { - "brightness": 0, - "description": "description", - "focal_point": { - "x": 0, - "y": 0 - } - } - } - } - } - ], - "thankyou_screens": [ - { - "ref": "nice-readable-thank-you-ref", - "title": "Thank you Title", - "properties": { - "show_button": True, - "button_text": "start", - "button_mode": "redirect", - "redirect_url": "https://www.typeform.com", - "share_icons": True - }, - "attachment": { - "type": "image", - "href": { - "image": { - "value": "https://images.typeform.com/images/4bcd3" - }, - "Pexels": { - "value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011" - }, - "Vimeo": { - "value": "https://vimeo.com/245714980" + "properties": {"description": "description"}, + }, + "layout": { + "type": "float", + "placement": "left", + "attachment": { + "type": "image", + "href": { + "image": {"value": "https://images.typeform.com/images/4bcd3"}, + "Pexels": {"value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011"}, + "Vimeo": {"value": "https://vimeo.com/245714980"}, + "YouTube": {"value": "https://www.youtube.com/watch?v=cGk3tZIIpXE"}, + }, + "scale": 0, + "properties": {"brightness": 0, "description": "description", "focal_point": {"x": 0, "y": 0}}, }, - "YouTube": { - "value": "https://www.youtube.com/watch?v=cGk3tZIIpXE" - } }, - "scale": 0, + } + ], + "thankyou_screens": [ + { + "ref": "nice-readable-thank-you-ref", + "title": "Thank you Title", "properties": { - "description": "description" - } - }, - "layout": { - "type": "float", - "placement": "left", + "show_button": True, + "button_text": "start", + "button_mode": "redirect", + "redirect_url": "https://www.typeform.com", + "share_icons": True, + }, "attachment": { "type": "image", "href": { - "image": { - "value": "https://images.typeform.com/images/4bcd3" - }, - "Pexels": { - "value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011" - }, - "Vimeo": { - "value": "https://vimeo.com/245714980" - }, - "YouTube": { - "value": "https://www.youtube.com/watch?v=cGk3tZIIpXE" - } + "image": {"value": "https://images.typeform.com/images/4bcd3"}, + "Pexels": {"value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011"}, + "Vimeo": {"value": "https://vimeo.com/245714980"}, + "YouTube": {"value": "https://www.youtube.com/watch?v=cGk3tZIIpXE"}, }, "scale": 0, - "properties": { - "brightness": 0, - "description": "description", - "focal_point": { - "x": 0, - "y": 0 - } - } - } - } - } - ], - "logic": [ - { - "type": "type", - "ref": "ref", - "actions": [ - { - "action": "action", - "details": { - "to": { - "type": "type", - "value": "value" + "properties": {"description": "description"}, + }, + "layout": { + "type": "float", + "placement": "left", + "attachment": { + "type": "image", + "href": { + "image": {"value": "https://images.typeform.com/images/4bcd3"}, + "Pexels": {"value": "https://www.pexels.com/video/people-traveling-in-the-desert-1739011"}, + "Vimeo": {"value": "https://vimeo.com/245714980"}, + "YouTube": {"value": "https://www.youtube.com/watch?v=cGk3tZIIpXE"}, }, - "target": { - "type": "type", - "value": "value" + "scale": 0, + "properties": {"brightness": 0, "description": "description", "focal_point": {"x": 0, "y": 0}}, + }, + }, + } + ], + "logic": [ + { + "type": "type", + "ref": "ref", + "actions": [ + { + "action": "action", + "details": { + "to": {"type": "type", "value": "value"}, + "target": {"type": "type", "value": "value"}, + "value": {"type": "type", "value": 0}, }, - "value": { - "type": "type", - "value": 0 - } - }, - "condition": { - "op": "op", - "vars": [ - { - "type": "type", - "value": {} - } - ] + "condition": {"op": "op", "vars": [{"type": "type", "value": {}}]}, } - } - ] - } - ], - "theme": { - "href": "https://api.typeform.com/themes/Fs24as" - }, - "workspace": { - "href": "https://api.typeform.com/workspaces/Aw33bz" - }, - "_links": { - "display": "https://subdomain.typeform.com/to/abc123" - }, - "settings": { - "language": "language", - "is_public": True, - "progress_bar": "proportion", - "show_progress_bar": True, - "show_typeform_branding": True, - "show_time_to_complete": True, - "hide_navigation": True, - "meta": { - "title": "title", - "allow_indexing": True, - "description": "description", - "image": { - "href": "href" + ], } + ], + "theme": {"href": "https://api.typeform.com/themes/Fs24as"}, + "workspace": {"href": "https://api.typeform.com/workspaces/Aw33bz"}, + "_links": {"display": "https://subdomain.typeform.com/to/abc123"}, + "settings": { + "language": "language", + "is_public": True, + "progress_bar": "proportion", + "show_progress_bar": True, + "show_typeform_branding": True, + "show_time_to_complete": True, + "hide_navigation": True, + "meta": {"title": "title", "allow_indexing": True, "description": "description", "image": {"href": "href"}}, + "redirect_after_submit_url": "redirect_after_submit_url", + "google_analytics": "google_analytics", + "facebook_pixel": "facebook_pixel", + "google_tag_manager": "google_tag_manager", + }, + "cui_settings": { + "avatar": "https://images.typeform.com/images/4bcd3", + "is_typing_emulation_disabled": True, + "typing_emulation_speed": "fast", }, - "redirect_after_submit_url": "redirect_after_submit_url", - "google_analytics": "google_analytics", - "facebook_pixel": "facebook_pixel", - "google_tag_manager": "google_tag_manager" }, - "cui_settings": { - "avatar": "https://images.typeform.com/images/4bcd3", - "is_typing_emulation_disabled": True, - "typing_emulation_speed": "fast" - } - }) + ) @pytest.fixture def forms_response(): - return setup_response(200, { - "total_items": 2, - "page_count": 1, - "items": [ - { - "id": "u6nXL7" - }, - { - "id": "k9xNV4" - } - ] - }) + return setup_response(200, {"total_items": 2, "page_count": 1, "items": [{"id": "u6nXL7"}, {"id": "k9xNV4"}]}) @pytest.fixture def response_response(): - return setup_response(200, { - "items": [ - { - "answers": [ - { - "field": { - "id": "hVONkQcnSNRj", - "ref": "my_custom_dropdown_reference", - "type": "dropdown" - }, - "text": "Job opportunities", - "type": "text" - }, - { - "boolean": False, - "field": { - "id": "RUqkXSeXBXSd", - "ref": "my_custom_yes_no_reference", - "type": "yes_no" - }, - "type": "boolean" - }, - { - "boolean": True, - "field": { - "id": "gFFf3xAkJKsr", - "ref": "my_custom_legal_reference", - "type": "legal" - }, - "type": "boolean" - }, - { - "field": { - "id": "JwWggjAKtOkA", - "ref": "my_custom_short_text_reference", - "type": "short_text" - }, - "text": "Lian", - "type": "text" - }, - { - "email": "lian1078@other.com", - "field": { - "id": "SMEUb7VJz92Q", - "ref": "my_custom_email_reference", - "type": "email" - }, - "type": "email" - }, - { - "field": { - "id": "pn48RmPazVdM", - "ref": "my_custom_number_reference", - "type": "number" - }, - "number": 1, - "type": "number" - }, - { - "field": { - "id": "Q7M2XAwY04dW", - "ref": "my_custom_number2_reference", - "type": "number" - }, - "number": 1, - "type": "number" - }, - { - "field": { - "id": "WOTdC00F8A3h", - "ref": "my_custom_rating_reference", - "type": "rating" - }, - "number": 3, - "type": "number" - }, - { - "field": { - "id": "DlXFaesGBpoF", - "ref": "my_custom_long_text_reference", - "type": "long_text" - }, - "text": "It's a big, busy city. I moved here for a job, but I like it, so I am planning to stay. I have made good friends here.", - "type": "text" - }, - { - "field": { - "id": "NRsxU591jIW9", - "ref": "my_custom_opinion_scale_reference", - "type": "opinion_scale" - }, - "number": 1, - "type": "number" - }, - { - "choices": { - "labels": [ - "New York", - "Tokyo" - ] - }, - "field": { - "id": "PNe8ZKBK8C2Q", - "ref": "my_custom_picture_choice_reference", - "type": "picture_choice" - }, - "type": "choices" - }, - { - "date": "2012-03-20T00:00:00Z", - "field": { - "id": "KoJxDM3c6x8h", - "ref": "my_custom_date_reference", - "type": "date" - }, - "type": "date" - }, - { - "choice": { - "label": "A friend's experience in Sydney" - }, - "field": { - "id": "ceIXxpbP3t2q", - "ref": "my_custom_multiple_choice_reference", - "type": "multiple_choice" - }, - "type": "choice" - }, - { - "choices": { - "labels": [ - "New York", - "Tokyo" - ] - }, - "field": { - "id": "abISxvbD5t1p", - "ref": "my_custom_ranking_reference", - "type": "ranking" - }, - "type": "choices" - }, - { - "choice": { - "label": "Tokyo" - }, - "field": { - "id": "k6TP9oLGgHjl", - "ref": "my_custom_multiple_choice2_reference", - "type": "multiple_choice" - }, - "type": "choice" - } - ], - "calculated": { - "score": 2 - }, - "hidden": {}, - "landed_at": "2017-09-14T22:33:59Z", - "landing_id": "21085286190ffad1248d17c4135ee56f", - "metadata": { - "browser": "default", - "network_id": "responsdent_network_id", - "platform": "other", - "referer": "https://user_id.typeform.com/to/lR6F4j", - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8" - }, - "response_id": "21085286190ffad1248d17c4135ee56f", - "submitted_at": "2017-09-14T22:38:22Z", - "token": "test21085286190ffad1248d17c4135ee56f", - "variables": [ - { - "key": "score", - "number": 2, - "type": "number" - }, - { - "key": "name", - "text": "typeform", - "type": "text" - } - ] - }, - { - "answers": [ - { - "choice": { - "label": "New York" - }, - "field": { - "id": "k6TP9oLGgHjl", - "ref": "my_custom_multiple_choice2_reference", - "type": "multiple_choice" - }, - "type": "choice" - }, - { - "field": { - "id": "X4BgU2f1K6tG", - "ref": "my_custom_file_upload_reference", - "type": "file_upload" - }, - "file_url": "https://api.typeform.com/forms/lT9Z2j/responses/7f46165474d11ee5836777d85df2cdab/fields/X4BgU2f1K6tG/files/afd8258fd453-aerial_view_rural_city_latvia_valmiera_urban_district_48132860.jpg", - "type": "file_url" - }, - { - "choice": { - "label": "Other" - }, - "field": { - "id": "ceIXxpbP3t2q", - "ref": "my_custom_multiple_choice_reference", - "type": "multiple_choice" - }, - "type": "choice" - }, - { - "field": { - "id": "hVONkQcnSNRj", - "ref": "my_custom_dropdown_reference", - "type": "dropdown" - }, - "text": "Cost of living", - "type": "text" - }, - { - "field": { - "id": "JwWggjAKtOkA", - "ref": "my_custom_short_text_reference", - "type": "short_text" - }, - "text": "Sarah", - "type": "text" - }, - { - "boolean": True, - "field": { - "id": "RUqkXSeXBXSd", - "ref": "my_custom_yes_no_reference", - "type": "yes_no" - }, - "type": "boolean" - }, - { - "field": { - "id": "Fep7sEoBsnvC", - "ref": "my_custom_long_text_reference", - "type": "long_text" - }, - "text": "I read a magazine article about traveling to Sydney", - "type": "text" - }, - { - "boolean": True, - "field": { - "id": "gFFf3xAkJKsr", - "ref": "my_custom_legal_reference", - "type": "legal" - }, - "type": "boolean" - }, - { - "field": { - "id": "BFcpoPU5yJPM", - "ref": "my_custom_short_text_reference", - "type": "short_text" - }, - "text": "San Francisco", - "type": "text" - }, - { - "email": "sarahbsmith@example.com", - "field": { - "id": "SMEUb7VJz92Q", - "ref": "my_custom_rmail_reference", - "type": "email" - }, - "type": "email" - }, - { - "field": { - "id": "pn48RmPazVdM", - "ref": "my_custom_number_reference", - "type": "number" - }, - "number": 1, - "type": "number" - }, - { - "field": { - "id": "WOTdC00F8A3h", - "ref": "my_custom_rating_reference", - "type": "rating" - }, - "number": 3, - "type": "number" - }, - { - "field": { - "id": "Q7M2XAwY04dW", - "ref": "my_custom_number2_reference", - "type": "number" - }, - "number": 3, - "type": "number" - }, - { - "field": { - "id": "DlXFaesGBpoF", - "ref": "my_custom_long_text_reference", - "type": "long_text" - }, - "text": "It's a rural area. Very quiet. There are a lot of farms...farming is the major industry here.", - "type": "text" - }, - { - "field": { - "id": "NRsxU591jIW9", - "ref": "my_custom_opinion_scale_reference", - "type": "opinion_scale" - }, - "number": 1, - "type": "number" - }, - { - "date": "2016-05-13T00:00:00Z", - "field": { - "id": "KoJxDM3c6x8h", - "ref": "my_custom_date_reference", - "type": "date" - }, - "type": "date" - }, - { - "choices": { - "labels": [ - "London", - "New York" - ] - }, - "field": { - "id": "PNe8ZKBK8C2Q", - "ref": "my_custom_picture_choice_reference", - "type": "picture_choice" - }, - "type": "choices" - } - ], - "calculated": { - "score": 4 - }, - "hidden": {}, - "landed_at": "2017-09-14T22:27:38Z", - "landing_id": "610fc266478b41e4927945e20fe54ad2", - "metadata": { - "browser": "default", - "network_id": "responsdent_network_id", - "platform": "other", - "referer": "https://user_id.typeform.com/to/lR6F4j", - "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" - }, - "submitted_at": "2017-09-14T22:33:56Z", - "token": "test610fc266478b41e4927945e20fe54ad2" - }, - { - "answers": [ - { - "boolean": False, - "field": { - "id": "RUqkXSeXBXSd", - "ref": "my_custom_yes_no_reference", - "type": "yes_no" - }, - "type": "boolean" - }, - { - "boolean": False, - "field": { - "id": "gFFf3xAkJKsr", - "ref": "my_custom_legal_reference", - "type": "legal" - }, - "type": "boolean" - }, - { - "field": { - "id": "JwWggjAKtOkA", - "ref": "my_custom_short_text_reference", - "type": "short_text" - }, - "text": "Paolo", - "type": "text" - }, - { - "field": { - "id": "pn48RmPazVdM", - "ref": "my_custom_number_reference", - "type": "number" - }, - "number": 5, - "type": "number" - }, - { - "field": { - "id": "Q7M2XAwY04dW", - "ref": "my_custom_number2_reference", - "type": "number" - }, - "number": 5, - "type": "number" - }, - { - "choices": { - "labels": [ - "Barcelona", - "Sydney" - ] - }, - "field": { - "id": "PNe8ZKBK8C2Q", - "ref": "my_custom_picture_choice_reference", - "type": "picture_choice" - }, - "type": "choices" - }, - { - "field": { - "id": "WOTdC00F8A3h", - "ref": "my_custom_rating_reference", - "type": "rating" - }, - "number": 5, - "type": "number" - }, - { - "field": { - "id": "DlXFaesGBpoF", - "ref": "my_custom_long_text_reference", - "type": "long_text" - }, - "text": "I live in a medium-sized European city. It's not too crowded, and the people are nice. I like the weather. It's also easy to travel to many beautiful and interesting vacation destinations from where I live.", - "type": "text" - }, - { - "field": { - "id": "NRsxU591jIW9", - "ref": "my_custom_opinion_scale_reference", - "type": "opinion_scale" - }, - "number": 4, - "type": "number" - }, - { - "date": "1999-08-01T00:00:00Z", - "field": { - "id": "KoJxDM3c6x8h", - "ref": "my_custom_date_reference", - "type": "date" - }, - "type": "date" - }, - { - "choice": { - "label": "Barcelona" - }, - "field": { - "id": "k6TP9oLGgHjl", - "ref": "my_custom_multiple_choice_reference", - "type": "multiple_choice" - }, - "type": "choice" - } - ], - "calculated": { - "score": 10 + return setup_response( + 200, + { + "items": [ + { + "answers": [ + { + "field": {"id": "hVONkQcnSNRj", "ref": "my_custom_dropdown_reference", "type": "dropdown"}, + "text": "Job opportunities", + "type": "text", + }, + { + "boolean": False, + "field": {"id": "RUqkXSeXBXSd", "ref": "my_custom_yes_no_reference", "type": "yes_no"}, + "type": "boolean", + }, + { + "boolean": True, + "field": {"id": "gFFf3xAkJKsr", "ref": "my_custom_legal_reference", "type": "legal"}, + "type": "boolean", + }, + { + "field": {"id": "JwWggjAKtOkA", "ref": "my_custom_short_text_reference", "type": "short_text"}, + "text": "Lian", + "type": "text", + }, + { + "email": "lian1078@other.com", + "field": {"id": "SMEUb7VJz92Q", "ref": "my_custom_email_reference", "type": "email"}, + "type": "email", + }, + { + "field": {"id": "pn48RmPazVdM", "ref": "my_custom_number_reference", "type": "number"}, + "number": 1, + "type": "number", + }, + { + "field": {"id": "Q7M2XAwY04dW", "ref": "my_custom_number2_reference", "type": "number"}, + "number": 1, + "type": "number", + }, + { + "field": {"id": "WOTdC00F8A3h", "ref": "my_custom_rating_reference", "type": "rating"}, + "number": 3, + "type": "number", + }, + { + "field": {"id": "DlXFaesGBpoF", "ref": "my_custom_long_text_reference", "type": "long_text"}, + "text": "It's a big, busy city. I moved here for a job, but I like it, so I am planning to stay. I have made good friends here.", + "type": "text", + }, + { + "field": {"id": "NRsxU591jIW9", "ref": "my_custom_opinion_scale_reference", "type": "opinion_scale"}, + "number": 1, + "type": "number", + }, + { + "choices": {"labels": ["New York", "Tokyo"]}, + "field": {"id": "PNe8ZKBK8C2Q", "ref": "my_custom_picture_choice_reference", "type": "picture_choice"}, + "type": "choices", + }, + { + "date": "2012-03-20T00:00:00Z", + "field": {"id": "KoJxDM3c6x8h", "ref": "my_custom_date_reference", "type": "date"}, + "type": "date", + }, + { + "choice": {"label": "A friend's experience in Sydney"}, + "field": {"id": "ceIXxpbP3t2q", "ref": "my_custom_multiple_choice_reference", "type": "multiple_choice"}, + "type": "choice", + }, + { + "choices": {"labels": ["New York", "Tokyo"]}, + "field": {"id": "abISxvbD5t1p", "ref": "my_custom_ranking_reference", "type": "ranking"}, + "type": "choices", + }, + { + "choice": {"label": "Tokyo"}, + "field": {"id": "k6TP9oLGgHjl", "ref": "my_custom_multiple_choice2_reference", "type": "multiple_choice"}, + "type": "choice", + }, + ], + "calculated": {"score": 2}, + "hidden": {}, + "landed_at": "2017-09-14T22:33:59Z", + "landing_id": "21085286190ffad1248d17c4135ee56f", + "metadata": { + "browser": "default", + "network_id": "responsdent_network_id", + "platform": "other", + "referer": "https://user_id.typeform.com/to/lR6F4j", + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8", + }, + "response_id": "21085286190ffad1248d17c4135ee56f", + "submitted_at": "2017-09-14T22:38:22Z", + "token": "test21085286190ffad1248d17c4135ee56f", + "variables": [{"key": "score", "number": 2, "type": "number"}, {"key": "name", "text": "typeform", "type": "text"}], }, - "hidden": {}, - "landed_at": "2017-09-14T22:24:49Z", - "landing_id": "9ba5db11ec6c63d22f08aade805bd363", - "metadata": { - "browser": "default", - "network_id": "responsdent_network_id", - "platform": "other", - "referer": "https://user_id.typeform.com/to/lR6F4j", - "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1" + { + "answers": [ + { + "choice": {"label": "New York"}, + "field": {"id": "k6TP9oLGgHjl", "ref": "my_custom_multiple_choice2_reference", "type": "multiple_choice"}, + "type": "choice", + }, + { + "field": {"id": "X4BgU2f1K6tG", "ref": "my_custom_file_upload_reference", "type": "file_upload"}, + "file_url": "https://api.typeform.com/forms/lT9Z2j/responses/7f46165474d11ee5836777d85df2cdab/fields/X4BgU2f1K6tG/files/afd8258fd453-aerial_view_rural_city_latvia_valmiera_urban_district_48132860.jpg", + "type": "file_url", + }, + { + "choice": {"label": "Other"}, + "field": {"id": "ceIXxpbP3t2q", "ref": "my_custom_multiple_choice_reference", "type": "multiple_choice"}, + "type": "choice", + }, + { + "field": {"id": "hVONkQcnSNRj", "ref": "my_custom_dropdown_reference", "type": "dropdown"}, + "text": "Cost of living", + "type": "text", + }, + { + "field": {"id": "JwWggjAKtOkA", "ref": "my_custom_short_text_reference", "type": "short_text"}, + "text": "Sarah", + "type": "text", + }, + { + "boolean": True, + "field": {"id": "RUqkXSeXBXSd", "ref": "my_custom_yes_no_reference", "type": "yes_no"}, + "type": "boolean", + }, + { + "field": {"id": "Fep7sEoBsnvC", "ref": "my_custom_long_text_reference", "type": "long_text"}, + "text": "I read a magazine article about traveling to Sydney", + "type": "text", + }, + { + "boolean": True, + "field": {"id": "gFFf3xAkJKsr", "ref": "my_custom_legal_reference", "type": "legal"}, + "type": "boolean", + }, + { + "field": {"id": "BFcpoPU5yJPM", "ref": "my_custom_short_text_reference", "type": "short_text"}, + "text": "San Francisco", + "type": "text", + }, + { + "email": "sarahbsmith@example.com", + "field": {"id": "SMEUb7VJz92Q", "ref": "my_custom_rmail_reference", "type": "email"}, + "type": "email", + }, + { + "field": {"id": "pn48RmPazVdM", "ref": "my_custom_number_reference", "type": "number"}, + "number": 1, + "type": "number", + }, + { + "field": {"id": "WOTdC00F8A3h", "ref": "my_custom_rating_reference", "type": "rating"}, + "number": 3, + "type": "number", + }, + { + "field": {"id": "Q7M2XAwY04dW", "ref": "my_custom_number2_reference", "type": "number"}, + "number": 3, + "type": "number", + }, + { + "field": {"id": "DlXFaesGBpoF", "ref": "my_custom_long_text_reference", "type": "long_text"}, + "text": "It's a rural area. Very quiet. There are a lot of farms...farming is the major industry here.", + "type": "text", + }, + { + "field": {"id": "NRsxU591jIW9", "ref": "my_custom_opinion_scale_reference", "type": "opinion_scale"}, + "number": 1, + "type": "number", + }, + { + "date": "2016-05-13T00:00:00Z", + "field": {"id": "KoJxDM3c6x8h", "ref": "my_custom_date_reference", "type": "date"}, + "type": "date", + }, + { + "choices": {"labels": ["London", "New York"]}, + "field": {"id": "PNe8ZKBK8C2Q", "ref": "my_custom_picture_choice_reference", "type": "picture_choice"}, + "type": "choices", + }, + ], + "calculated": {"score": 4}, + "hidden": {}, + "landed_at": "2017-09-14T22:27:38Z", + "landing_id": "610fc266478b41e4927945e20fe54ad2", + "metadata": { + "browser": "default", + "network_id": "responsdent_network_id", + "platform": "other", + "referer": "https://user_id.typeform.com/to/lR6F4j", + "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36", + }, + "submitted_at": "2017-09-14T22:33:56Z", + "token": "test610fc266478b41e4927945e20fe54ad2", }, - "submitted_at": "2017-09-14T22:27:34Z", - "token": "9ba5db11ec6c63d22f08aade805bd363" - }, - { - "answers": [], - "calculated": { - "score": 0 + { + "answers": [ + { + "boolean": False, + "field": {"id": "RUqkXSeXBXSd", "ref": "my_custom_yes_no_reference", "type": "yes_no"}, + "type": "boolean", + }, + { + "boolean": False, + "field": {"id": "gFFf3xAkJKsr", "ref": "my_custom_legal_reference", "type": "legal"}, + "type": "boolean", + }, + { + "field": {"id": "JwWggjAKtOkA", "ref": "my_custom_short_text_reference", "type": "short_text"}, + "text": "Paolo", + "type": "text", + }, + { + "field": {"id": "pn48RmPazVdM", "ref": "my_custom_number_reference", "type": "number"}, + "number": 5, + "type": "number", + }, + { + "field": {"id": "Q7M2XAwY04dW", "ref": "my_custom_number2_reference", "type": "number"}, + "number": 5, + "type": "number", + }, + { + "choices": {"labels": ["Barcelona", "Sydney"]}, + "field": {"id": "PNe8ZKBK8C2Q", "ref": "my_custom_picture_choice_reference", "type": "picture_choice"}, + "type": "choices", + }, + { + "field": {"id": "WOTdC00F8A3h", "ref": "my_custom_rating_reference", "type": "rating"}, + "number": 5, + "type": "number", + }, + { + "field": {"id": "DlXFaesGBpoF", "ref": "my_custom_long_text_reference", "type": "long_text"}, + "text": "I live in a medium-sized European city. It's not too crowded, and the people are nice. I like the weather. It's also easy to travel to many beautiful and interesting vacation destinations from where I live.", + "type": "text", + }, + { + "field": {"id": "NRsxU591jIW9", "ref": "my_custom_opinion_scale_reference", "type": "opinion_scale"}, + "number": 4, + "type": "number", + }, + { + "date": "1999-08-01T00:00:00Z", + "field": {"id": "KoJxDM3c6x8h", "ref": "my_custom_date_reference", "type": "date"}, + "type": "date", + }, + { + "choice": {"label": "Barcelona"}, + "field": {"id": "k6TP9oLGgHjl", "ref": "my_custom_multiple_choice_reference", "type": "multiple_choice"}, + "type": "choice", + }, + ], + "calculated": {"score": 10}, + "hidden": {}, + "landed_at": "2017-09-14T22:24:49Z", + "landing_id": "9ba5db11ec6c63d22f08aade805bd363", + "metadata": { + "browser": "default", + "network_id": "responsdent_network_id", + "platform": "other", + "referer": "https://user_id.typeform.com/to/lR6F4j", + "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1", + }, + "submitted_at": "2017-09-14T22:27:34Z", + "token": "9ba5db11ec6c63d22f08aade805bd363", }, - "hidden": {}, - "landed_at": "2017-09-15T09:09:30Z", - "landing_id": "5fcb3f9c162e1fcdaadff4405b741080", - "metadata": { - "browser": "default", - "network_id": "responsdent_network_id", - "platform": "other", - "referer": "https://user_id.typeform.com/to/lR6F4j", - "user_agent": "Mozilla/5.0 (Linux; Android 4.1.2; GT-N7000 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36" + { + "answers": [], + "calculated": {"score": 0}, + "hidden": {}, + "landed_at": "2017-09-15T09:09:30Z", + "landing_id": "5fcb3f9c162e1fcdaadff4405b741080", + "metadata": { + "browser": "default", + "network_id": "responsdent_network_id", + "platform": "other", + "referer": "https://user_id.typeform.com/to/lR6F4j", + "user_agent": "Mozilla/5.0 (Linux; Android 4.1.2; GT-N7000 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36", + }, + "submitted_at": "0001-01-01T00:00:00Z", + "token": "test5fcb3f9c162e1fcdaadff4405b741080", }, - "submitted_at": "0001-01-01T00:00:00Z", - "token": "test5fcb3f9c162e1fcdaadff4405b741080" - } - ], - "page_count": 1, - "total_items": 4 - - }) + ], + "page_count": 1, + "total_items": 4, + }, + ) @pytest.fixture @@ -775,9 +454,4 @@ def empty_response_bad(): def setup_response(status, body): - return [ - { - "json": body, - "status_code": status - } - ] + return [{"json": body, "status_code": status}] diff --git a/airbyte-integrations/connectors/source-typeform/unit_tests/test_source.py b/airbyte-integrations/connectors/source-typeform/unit_tests/test_source.py index 762f4492767a6..f07f349a12027 100644 --- a/airbyte-integrations/connectors/source-typeform/unit_tests/test_source.py +++ b/airbyte-integrations/connectors/source-typeform/unit_tests/test_source.py @@ -1,7 +1,10 @@ +# +# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# + import re from airbyte_cdk import AirbyteLogger - from source_typeform import SourceTypeform from source_typeform.source import TypeformStream diff --git a/airbyte-integrations/connectors/source-typeform/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-typeform/unit_tests/test_streams.py index 149b81015b3e5..30d4591a9f183 100644 --- a/airbyte-integrations/connectors/source-typeform/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-typeform/unit_tests/test_streams.py @@ -1,15 +1,19 @@ -from typing import List, Mapping, Any +# +# Copyright (c) 2021 Airbyte, Inc., all rights reserved. +# + +from typing import Any, List, Mapping from unittest.mock import MagicMock from airbyte_cdk import AirbyteLogger from airbyte_cdk.models import SyncMode - -from source_typeform.source import TypeformStream, Forms, Responses +from source_typeform.source import Forms, Responses, TypeformStream logger = AirbyteLogger() TYPEFORM_BASE_URL = TypeformStream.url_base + def merge_records(stream: TypeformStream, sync_mode: SyncMode) -> List[Mapping[str, Any]]: merged_records = [] for stream_slice in stream.stream_slices(sync_mode=sync_mode):