### What For newly generated python and low-code connectors, move sources from `src` to `source_%CONN_NAME%` so `airbyte-ci build` can pick them up correctly. Closes #35893. ### What changed? - Moved the sources from `src` - Updated package paths in `pyproject.toml` templates ### How to test? You can make a new connector with `./generate.sh` and verify that it works with Poetry and that it builds with `airbyte-ci build --name source-test` ---
23 lines
655 B
Handlebars
23 lines
655 B
Handlebars
#
|
|
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
|
#
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from source_{{snakeCase name}}.source import Source{{properCase name}}
|
|
|
|
|
|
def test_check_connection(mocker):
|
|
source = Source{{properCase name}}()
|
|
logger_mock, config_mock = MagicMock(), MagicMock()
|
|
assert source.check_connection(logger_mock, config_mock) == (True, None)
|
|
|
|
|
|
def test_streams(mocker):
|
|
source = Source{{properCase name}}()
|
|
config_mock = MagicMock()
|
|
streams = source.streams(config_mock)
|
|
# TODO: replace this with your streams number
|
|
expected_streams_number = 2
|
|
assert len(streams) == expected_streams_number
|