my.calendar.holidays: unhardcode calendar, detect it from the location data
This commit is contained in:
parent
bdb5dcd221
commit
96113ad5ae
5 changed files with 49 additions and 7 deletions
|
@ -1,6 +1,19 @@
|
|||
from pathlib import Path
|
||||
|
||||
import pytest # type: ignore
|
||||
|
||||
from my.calendar.holidays import is_holiday
|
||||
|
||||
|
||||
def test() -> None:
|
||||
assert is_holiday('20190101')
|
||||
assert not is_holiday('20180601')
|
||||
assert is_holiday('20200906') # national holiday in Bulgaria
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def prepare(tmp_path: Path):
|
||||
from . import tz
|
||||
# todo meh. fixtures can't be called directly?
|
||||
orig = tz.prepare.__wrapped__ # type: ignore
|
||||
yield from orig(tmp_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue