Skip to content

Commit

Permalink
Fix metobs integration tests, SMHI API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcth committed Jan 9, 2024
1 parent bba4353 commit 9c6b3c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/fixtures/metobs_integration_1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Stationsnamn": "Karesuando A", "Stationsnummer": 192840, "Stationsn\u00e4t": "SMHIs stationsn\u00e4t", "M\u00e4th\u00f6jd (meter \u00f6ver marken)": 2.0, "Parameternamn": "Lufttemperatur", "Beskrivning": "momentanv\u00e4rde, 1 g\u00e5ng/tim", "Enhet": "degree celsius", "Tidsperiod (fr.o.m)": "2008-11-01 00:00:00", "Tidsperiod (t.o.m)": "2023-02-01 08:00:00", "H\u00f6jd (meter \u00f6ver havet)": 329.68, "Latitud (decimalgrader)": 68.4418, "Longitud (decimalgrader)": 22.4435}
{"Stationsnamn": "Karesuando A", "Stationsnummer": 192840, "Stationsn\u00e4t": "SMHIs stationsn\u00e4t", "M\u00e4th\u00f6jd (meter \u00f6ver marken)": 2.0, "Parameternamn": "Lufttemperatur", "Beskrivning": "momentanv\u00e4rde, 1 g\u00e5ng/tim", "Enhet": "celsius", "Tidsperiod (fr.o.m)": "2008-11-01 00:00:00", "Tidsperiod (t.o.m)": "2023-02-01 08:00:00", "H\u00f6jd (meter \u00f6ver havet)": 329.68, "Latitud (decimalgrader)": 68.4418, "Longitud (decimalgrader)": 22.4435}
2 changes: 1 addition & 1 deletion tests/fixtures/metobs_integration_2.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Stationsnamn": "Karesuando A", "Stationsnummer": 192840, "Stationsn\u00e4t": "SMHIs stationsn\u00e4t", "M\u00e4th\u00f6jd (meter \u00f6ver marken)": 2.0, "Parameternamn": "Lufttemperatur", "Beskrivning": "momentanv\u00e4rde, 1 g\u00e5ng/tim", "Enhet": "degree celsius", "Tidsperiod (fr.o.m)": "2008-11-01 00:00:00", "Tidsperiod (t.o.m)": "2023-02-01 08:00:00", "H\u00f6jd (meter \u00f6ver havet)": 329.68, "Latitud (decimalgrader)": 68.4418, "Longitud (decimalgrader)": 22.4435}
{"Stationsnamn": "Karesuando A", "Stationsnummer": 192840, "Stationsn\u00e4t": "SMHIs stationsn\u00e4t", "M\u00e4th\u00f6jd (meter \u00f6ver marken)": 2.0, "Parameternamn": "Lufttemperatur", "Beskrivning": "momentanv\u00e4rde, 1 g\u00e5ng/tim", "Enhet": "celsius", "Tidsperiod (fr.o.m)": "2008-11-01 00:00:00", "Tidsperiod (t.o.m)": "2023-02-01 08:00:00", "H\u00f6jd (meter \u00f6ver havet)": 329.68, "Latitud (decimalgrader)": 68.4418, "Longitud (decimalgrader)": 22.4435}
12 changes: 6 additions & 6 deletions tests/integration/test_integration_metobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
with open("tests/fixtures/metobs_integration_1.json") as f:
metobs_integration_1 = json.load(f)
metobs_integration_1["Tidsperiod (t.o.m)"] = (
datetime.date.today().strftime("%Y-%m") + "-01 08:00:00"
datetime.date.today().strftime("%Y-%m") + "-01 07:20:09"
)

with open("tests/fixtures/metobs_integration_2.json") as f:
metobs_integration_2 = json.load(f)
metobs_integration_2["Tidsperiod (t.o.m)"] = (
datetime.date.today().strftime("%Y-%m") + "-01 08:00:00"
datetime.date.today().strftime("%Y-%m") + "-01 07:20:09"
)


Expand Down Expand Up @@ -60,9 +60,9 @@ class TestIntegrationMetobs:
"\ufeffStationsnamn;Stationsnummer;Stationsnät;Mäthöjd (meter "
+ "över marken)\nKaresuando A;192840;SMHIs stationsnät;2.0\n\n"
+ "Parameternamn;Beskrivning;Enhet\nLufttemperatur;momentanvärde, "
+ "1 gång/tim;degree celsius\n\nTidsperiod (fr.o.m);Tidsperiod "
+ "1 gång/tim;celsius\n\nTidsperiod (fr.o.m);Tidsperiod "
+ "(t.o.m);Höjd (meter över havet);Latitud (decimalgrader);Longitud "
+ "(decimalgrader)\n2008-11-01 00:00:00;{{ date }} 08:00:00;329.68;"
+ "(decimalgrader)\n2008-11-01 00:00:00;{{ date }} 07:20:09;329.68;"
+ "68.4418;22.4435\n\n",
metobs_integration_2,
),
Expand Down Expand Up @@ -163,9 +163,9 @@ def test_integration_metobs_first(
"\ufeffStationsnamn;Stationsnummer;Stationsnät;Mäthöjd (meter "
+ "över marken)\nKaresuando A;192840;SMHIs stationsnät;2.0\n\n"
+ "Parameternamn;Beskrivning;Enhet\nLufttemperatur;momentanvärde, "
+ "1 gång/tim;degree celsius\n\nTidsperiod (fr.o.m);Tidsperiod "
+ "1 gång/tim;celsius\n\nTidsperiod (fr.o.m);Tidsperiod "
+ "(t.o.m);Höjd (meter över havet);Latitud (decimalgrader);Longitud "
+ "(decimalgrader)\n2008-11-01 00:00:00;{{ date }} 08:00:00;329.68;"
+ "(decimalgrader)\n2008-11-01 00:00:00;{{ date }} 07:20:09;329.68;"
+ "68.4418;22.4435\n\n",
metobs_integration_2,
),
Expand Down

0 comments on commit 9c6b3c2

Please sign in to comment.