Skip to content

Commit

Permalink
Updated mapping_suite_transformer test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolea Plesco committed Apr 26, 2022
1 parent 05b51a5 commit ee31333
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
33 changes: 29 additions & 4 deletions tests/e2e/notice_transformer/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
import pathlib
from pathlib import Path

import pytest

from tests import TEST_DATA_PATH


@pytest.fixture
def rml_test_package_path() -> pathlib.Path:
def rml_test_package_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_repository" / "test_package"


@pytest.fixture
def rml_non_existing_test_package_path() -> pathlib.Path:
return TEST_DATA_PATH / "notice_transformer" / "test_repository" / "non_existing_test_package"
def rml_non_existing_test_package_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_repository" / "non_existing_test_package"


@pytest.fixture
def fake_mapping_suite_id() -> str:
return "test_package"


@pytest.fixture
def fake_not_mapping_suite_id() -> str:
return "test_not_package"


@pytest.fixture
def fake_failed_mapping_suite_id() -> str:
return "test_failed_package"


@pytest.fixture
def fake_fail_repository_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_fail_packages"


@pytest.fixture
def fake_repository_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_repository"
28 changes: 2 additions & 26 deletions tests/unit/notice_transformer/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,14 @@ def fake_rml_mapper() -> RMLMapperABC:
return rml_mapper


@pytest.fixture
def fake_mapping_suite_id() -> str:
return "test_package"


@pytest.fixture
def fake_not_mapping_suite_id() -> str:
return "test_not_package"


@pytest.fixture
def fake_failed_mapping_suite_id() -> str:
return "test_failed_package"


@pytest.fixture
def fake_fail_repository_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_fail_packages"


@pytest.fixture
def fake_repository_path() -> Path:
return TEST_DATA_PATH / "notice_transformer" / "test_repository"


@pytest.fixture
def fake_mapping_suite(fake_repository_path, fake_mapping_suite_id) -> MappingSuite:
repository_path = fake_repository_path
mapping_suite_repository = MappingSuiteRepositoryInFileSystem(repository_path=repository_path)
return mapping_suite_repository.get(reference=fake_mapping_suite_id)


@pytest.fixture
@mongomock.patch(servers=(('server.example.com', 27017),))
def mongodb_client():
return pymongo.MongoClient('server.example.com')
return pymongo.MongoClient('server.example.com')

0 comments on commit ee31333

Please sign in to comment.