Skip to content

Commit 3160691

Browse files
committed
fix relative resource paths
1 parent 5dff39e commit 3160691

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

unit_tests/source_declarative_manifest/conftest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@
99
import yaml
1010

1111

12-
def get_fixture_path(file_name):
13-
return Path(__file__).parent.parent / file_name
12+
def get_resource_path(file_name) -> str:
13+
return Path(__file__).parent.parent / "resources" / file_name
1414

1515

1616
@pytest.fixture
1717
def valid_remote_config():
18-
return get_fixture_path("resources/valid_remote_config.json")
18+
return get_resource_path("valid_remote_config.json")
1919

2020

2121
@pytest.fixture
2222
def invalid_remote_config():
23-
return get_fixture_path("resources/invalid_remote_config.json")
23+
return get_resource_path("invalid_remote_config.json")
2424

2525

2626
@pytest.fixture
2727
def valid_local_manifest():
28-
return get_fixture_path("resources/valid_local_manifest.yaml")
28+
return get_resource_path("valid_local_manifest.yaml")
2929

3030

3131
@pytest.fixture
3232
def invalid_local_manifest():
33-
return get_fixture_path("resources/invalid_local_manifest.yaml")
33+
return get_resource_path("invalid_local_manifest.yaml")
3434

3535

3636
@pytest.fixture
@@ -47,9 +47,9 @@ def invalid_local_manifest_yaml(invalid_local_manifest):
4747

4848
@pytest.fixture
4949
def valid_local_config_file():
50-
return get_fixture_path("resources/valid_local_pokeapi_config.json")
50+
return get_resource_path("valid_local_pokeapi_config.json")
5151

5252

5353
@pytest.fixture
5454
def invalid_local_config_file():
55-
return get_fixture_path("resources/invalid_local_pokeapi_config.json")
55+
return get_resource_path("invalid_local_pokeapi_config.json")

unit_tests/source_declarative_manifest/test_source_declarative_w_custom_components.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from tempfile import NamedTemporaryFile
1414
from typing import Any
1515

16+
from dpath import get
1617
import pytest
1718
import yaml
1819
from airbyte_protocol_dataclasses.models.airbyte_protocol import AirbyteCatalog
@@ -44,8 +45,8 @@ def sample_method(self) -> str:
4445
"""
4546

4647

47-
def get_fixture_path(file_name) -> str:
48-
return Path(__file__).parent.parent / file_name
48+
def get_resource_path(file_name) -> str:
49+
return Path(__file__).parent.parent / "resources" / file_name
4950

5051

5152
def test_components_module_from_string() -> None:
@@ -90,7 +91,7 @@ def get_py_components_config_dict(
9091
*,
9192
failing_components: bool = False,
9293
) -> dict[str, Any]:
93-
connector_dir = Path(get_fixture_path("resources/source_pokeapi_w_components_py"))
94+
connector_dir = Path(get_resource_path("source_pokeapi_w_components_py"))
9495
manifest_yml_path: Path = connector_dir / "manifest.yaml"
9596
custom_py_code_path: Path = connector_dir / (
9697
"components.py" if not failing_components else "components_failing.py"

0 commit comments

Comments
 (0)