Skip to content

Commit

Permalink
fix mock issue with config
Browse files Browse the repository at this point in the history
  • Loading branch information
diversemix committed Oct 20, 2023
1 parent 5ba91c6 commit b1ef7cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions unit_tests/mocks/repos/config_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from sqlalchemy import exc

from app.model.config import ConfigReadDTO
from app.model.config import ConfigReadDTO, DocumentConfig, EventConfig


def mock_config_repo(config_repo, monkeypatch: MonkeyPatch, mocker):
Expand All @@ -16,7 +16,13 @@ def maybe_throw():

def mock_get(_) -> Optional[ConfigReadDTO]:
maybe_throw()
return ConfigReadDTO(geographies=[], taxonomies={}, languages={})
return ConfigReadDTO(
geographies=[],
taxonomies={},
languages={},
document=DocumentConfig(roles=[], types=[], variants=[]),
event=EventConfig(types=[]),
)

monkeypatch.setattr(config_repo, "get", mock_get)
mocker.spy(config_repo, "get")

0 comments on commit b1ef7cf

Please sign in to comment.