* Source Chargebee: migrate to YAML * Source Chargebee: add expected records * Source Chargebee: fix tests * Source Chargebee: update docs * Source Chargebee: update schemas * Source Chargebee: update expected records; Remove subscription expected records (field current_term_start updated daily) * Source Chargebee: fix test * Source Chargebee: ref * Source Chargebee: modify Error Handler to ignore product catalog v1.0 streams * Source Chargebee: fix expected records * Source Chargebee: fix expected records * auto-bump connector version * Source Chargebee: remove extra component * Source Chargebee: add docs * Source ChargeBee: update Yaml + expected records * Source ChargeBee: fix promotional credit stream, increase test timeout * Source ChargeBee: fix credit note * Source ChargeBee: Increase timeout * Source ChargeBee: add allowedHosts * Source ChargeBee: add comment * Source ChargeBee: migrate according to beta 0.29.0 * Source ChargeBee: update schemas * Source ChargeBee: update slicer info * Source ChargeBee: update manifest * Source ChargeBee: update test config * Source ChargeBee: bump version * Source Amplitude: update low-code * Source ChargeBee: fix manifest * Source Chargebee: update expected records; fix manifest * Source Chargebee: update expected records * Source Chargebee: update version * Source Chargebee: pin CDK to version beta 0.29 * Source Chargebee: add backward compatibility * Source Chargebee: fix expected records * Source Chargebee: update expected records * auto-bump connector version --------- Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com> Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com> Co-authored-by: sh4sh <6833405+sh4sh@users.noreply.github.com>
24 lines
856 B
Python
24 lines
856 B
Python
#
|
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
#
|
|
|
|
import pytest
|
|
from source_chargebee.components import CustomFieldTransformation
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"record, expected_record",
|
|
[
|
|
({'pk': 1, 'name': "example"}, {'pk': 1, 'name': "example", "custom_fields": []}),
|
|
({'pk': 1, 'name': "example", "cf_field1": "val1", "cf_field2": "val2"},
|
|
{'pk': 1, 'name': "example", "cf_field1": "val1", "cf_field2": "val2",
|
|
"custom_fields": [{"name": "cf_field1", "value": "val1"},
|
|
{"name": "cf_field2", "value": "val2"}]})
|
|
],
|
|
ids=["no_custom_field", "custom_field"]
|
|
)
|
|
def test_field_transformation(record, expected_record):
|
|
transformer = CustomFieldTransformation()
|
|
transformed_record = transformer.transform(record)
|
|
assert transformed_record == expected_record
|