Skip to content

Commit

Permalink
✨ feat(Source sftp-bulk): upgrade to CDK 5 (#46323)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldogonzalez8 authored Oct 3, 2024
1 parent 07365b0 commit 3866702
Show file tree
Hide file tree
Showing 5 changed files with 757 additions and 446 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from copy import deepcopy
from typing import Any, Mapping

from airbyte_cdk import ConfiguredAirbyteCatalog, Status
import pytest
from airbyte_cdk import AirbyteTracedException, ConfiguredAirbyteCatalog, Status
from airbyte_cdk.sources.declarative.models import FailureType
from airbyte_cdk.test.entrypoint_wrapper import read
from source_sftp_bulk import SourceSFTPBulk

Expand All @@ -21,14 +23,17 @@ def test_check_invalid_private_key_config(configured_catalog: ConfiguredAirbyteC
"private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nbaddata\n-----END OPENSSH PRIVATE KEY-----",
}
}
outcome = SourceSFTPBulk(catalog=configured_catalog, config=invalid_config, state=None).check(logger, invalid_config)
assert outcome.status == Status.FAILED
with pytest.raises(AirbyteTracedException) as exc_info:
SourceSFTPBulk(catalog=configured_catalog, config=invalid_config, state=None).check(logger, invalid_config)

assert exc_info.value.failure_type.value == FailureType.config_error.value


def test_check_invalid_config(configured_catalog: ConfiguredAirbyteCatalog, config: Mapping[str, Any]):
invalid_config = config | {"credentials": {"auth_type": "password", "password": "wrongpass"}}
outcome = SourceSFTPBulk(catalog=configured_catalog, config=invalid_config, state=None).check(logger, invalid_config)
assert outcome.status == Status.FAILED
with pytest.raises(AirbyteTracedException) as exc_info:
SourceSFTPBulk(catalog=configured_catalog, config=invalid_config, state=None).check(logger, invalid_config)
assert exc_info.value.failure_type.value == FailureType.config_error.value


def test_check_valid_config_private_key(configured_catalog: ConfiguredAirbyteCatalog, config_private_key: Mapping[str, Any]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 31e3242f-dee7-4cdc-a4b8-8e06c5458517
dockerImageTag: 1.1.0
dockerImageTag: 1.2.0
dockerRepository: airbyte/source-sftp-bulk
documentationUrl: https://docs.airbyte.com/integrations/sources/sftp-bulk
githubIssueLabel: source-sftp-bulk
Expand Down
Loading

0 comments on commit 3866702

Please sign in to comment.