-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ced498
commit 2c556ee
Showing
12 changed files
with
231 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
from typing import Iterator | ||
|
||
import pytest | ||
from adrpy.injection import setup_injection | ||
from lidipy import Lidi | ||
|
||
from tests.fixtures.repository import TEST_DIRECTORY | ||
import shutil | ||
|
||
|
||
pytest_plugins = [ | ||
"tests.fixtures" | ||
] | ||
|
||
@pytest.fixture | ||
def lidi() -> Lidi: | ||
from adrpy.injection import lidi | ||
|
||
setup_injection() | ||
yield lidi | ||
|
||
@pytest.fixture(autouse=True) | ||
def remove_test_file() -> Iterator[None]: | ||
yield | ||
shutil.rmtree(TEST_DIRECTORY, ignore_errors=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .repository import repo_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from pathlib import Path | ||
from typing import Iterator | ||
|
||
import pytest | ||
from lidipy import Lidi | ||
|
||
from adrpy.repositories.adr.base import BaseADRRepository | ||
from adrpy.repositories.adr.repository import ADRFileRepository | ||
from adrpy.shared_kernel.settings import Settings | ||
|
||
TEST_DIRECTORY = Path(__file__).parent / "testdir" | ||
TEST_FILENAME = "testfile" | ||
TEST_FILENAME_WITH_EXTENSION = "testfile.md" | ||
|
||
|
||
@pytest.fixture() | ||
def repo_service(lidi: Lidi) -> Iterator[BaseADRRepository]: | ||
original_repo = lidi.resolve(BaseADRRepository) | ||
original_settings = lidi.resolve(Settings) | ||
new_settings = Settings(initial_adr_dir=TEST_DIRECTORY) | ||
lidi.bind(BaseADRRepository, ADRFileRepository(settings=new_settings)) | ||
yield lidi.resolve(BaseADRRepository) | ||
lidi.bind(BaseADRRepository, original_repo) | ||
lidi.bind(Settings, original_settings) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters