-
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 7e421d0
Showing
12 changed files
with
228 additions
and
201 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,24 @@ | ||
import shutil | ||
from typing import Iterator | ||
|
||
import pytest | ||
from adrpy.injection import setup_injection | ||
from lidipy import Lidi | ||
|
||
from tests.fixtures.repository import TEST_DIRECTORY | ||
|
||
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) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pathlib import Path | ||
from typing import Iterator | ||
|
||
import pytest | ||
from adrpy.repositories.adr.base import BaseADRRepository | ||
from adrpy.repositories.adr.repository import ADRFileRepository | ||
from adrpy.shared_kernel.settings import Settings | ||
from lidipy import Lidi | ||
|
||
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) |
Empty file.
26 changes: 1 addition & 25 deletions
26
...mplementation/test_adr_file_repository.py → ...mplementation/test_adr_file_repository.py
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