-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #764 from krebslw/api-tidsserier
Tilføjelser og ændinger til det "generelle" Tidsserie-api
- Loading branch information
Showing
2 changed files
with
74 additions
and
15 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
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,34 @@ | ||
import pytest | ||
|
||
import fire | ||
from fire.cli import FireDb | ||
from fire.api.model import ( | ||
Tidsserie, | ||
HøjdeTidsserie, | ||
GNSSTidsserie, | ||
) | ||
|
||
|
||
def test_tidsserie_attributter(firedb: FireDb): | ||
""" | ||
Test at man kan trække de forventede attributter ud med Tidsserie-api'et. | ||
Vi tager udgangspunkt i 'HTS_AARHUS_K-63-19113', der har fire koordinater i tidsserien. | ||
""" | ||
|
||
ts = firedb.hent_tidsserie("HTS_AARHUS_K-63-19113") | ||
|
||
# Test implementering af __len__ | ||
assert len(ts) == 4 | ||
|
||
assert ts.referenceramme == ts.srid.kortnavn | ||
|
||
assert isinstance(ts, HøjdeTidsserie) | ||
assert hasattr(ts, "kote") | ||
assert hasattr(ts, "sz") | ||
|
||
assert len(ts.kote) == len(ts.sz) | ||
|
||
for k, sz in zip(ts.kote, ts.sz): | ||
assert isinstance(k, float) | ||
assert isinstance(sz, float) |