specify accuracy in shared config

otherwise, it seems to use my config
from ~/.config/my/my... instead of
relying on the defaults in each module
This commit is contained in:
Sean Breckenridge 2023-02-27 00:48:01 -08:00
parent 8d503783aa
commit 6074f04fe8
2 changed files with 4 additions and 2 deletions

View file

@ -90,7 +90,8 @@ def test_ip_fallback() -> None:
from my.location.fallback.common import _iter_estimate_from from my.location.fallback.common import _iter_estimate_from
raw_est = list(_iter_estimate_from(use_dt, (via_ip.estimate_location,))) raw_est = list(_iter_estimate_from(use_dt, (via_ip.estimate_location,)))
assert len(raw_est) == 1 assert len(raw_est) == 1
assert raw_est[0].accuracy == 10_000 assert raw_est[0].datasource == "via_ip"
assert raw_est[0].accuracy == 15_000
# passing home should give one # passing home should give one
home_est = list(_iter_estimate_from(use_dt, (via_home.estimate_location,))) home_est = list(_iter_estimate_from(use_dt, (via_home.estimate_location,)))

View file

@ -41,6 +41,7 @@ def temp_config(temp_path: Path) -> Any:
LTZ.config.fast = True LTZ.config.fast = True
class location: class location:
home_accuracy = 30_000
home = ( home = (
# supports ISO strings # supports ISO strings
('2005-12-04' , (42.697842, 23.325973)), # Bulgaria, Sofia ('2005-12-04' , (42.697842, 23.325973)), # Bulgaria, Sofia
@ -51,7 +52,7 @@ def temp_config(temp_path: Path) -> Any:
) )
# note: order doesn't matter, will be sorted in the data provider # note: order doesn't matter, will be sorted in the data provider
class via_ip: class via_ip:
pass accuracy = 15_000
class gpslogger: class gpslogger:
pass pass