my.google.takeout.paths: migrate to new style lazy config
also clean up tests a little and move into my.tests.location.google
This commit is contained in:
parent
2ff2dcfc00
commit
7cae9d5bf3
4 changed files with 86 additions and 46 deletions
|
@ -1,28 +0,0 @@
|
|||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def test() -> None:
|
||||
from my.location.google import locations
|
||||
locs = list(locations())
|
||||
assert len(locs) == 3810
|
||||
|
||||
last = locs[-1]
|
||||
assert last.dt.strftime('%Y%m%d %H:%M:%S') == '20170802 13:01:56' # should be utc
|
||||
# todo approx
|
||||
assert last.lat == 46.5515350
|
||||
assert last.lon == 16.4742742
|
||||
# todo check altitude
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def prepare(tmp_path: Path):
|
||||
from .shared_config import temp_config
|
||||
user_config = temp_config(tmp_path)
|
||||
|
||||
import my.core.cfg as C
|
||||
with C.tmp_config() as config:
|
||||
config.google = user_config.google
|
||||
yield
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue