1
0
mirror of synced 2026-01-23 04:02:42 -05:00
Files
airbyte/airbyte-integrations/connector-templates/source-python/unit_tests/test_source.py.hbs
Natik Gadzhi 0e9bdf314d connector-templates: move generated code from src so airbyte-ci builds it (#36428)
### 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`

---
2024-03-25 10:01:30 -07:00

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