Skip to content

Commit

Permalink
Tests: Fix test after Angermünde added more 2022 reports
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jul 1, 2023
1 parent f897429 commit d2865aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_cli_observations_filter_invalid_readings(capsys):
"""
CLI test: Verify the `observations` subcommand works, with filtering by quality-byte.
"""
run_command("phenodata observations --source=dwd --dataset=immediate --partition=recent --filename=Hasel --quality-byte=5,6,7,8 --humanize --show-ids --format=json")
run_command("phenodata observations --source=dwd --dataset=immediate --partition=recent --year=2021 --filename=Hasel --quality-byte=5,6,7,8 --humanize --show-ids --format=json")

out, err = capsys.readouterr()
response = json.loads(out)
Expand All @@ -181,7 +181,7 @@ def test_cli_observations_filter_invalid_readings(capsys):
"QS-Level": "ROUTKLI validated [7]",
"QS-Byte": "Feldwert zweifelhaft [5]"
}
assert_equal(response[0], first)
assert_equal(first, response[0])


def test_cli_observations_filter_sql(capsys):
Expand Down Expand Up @@ -225,7 +225,9 @@ def test_cli_observations_format_csv(capsys):
assert out.startswith("""
Jahr,Datum,Tag,Spezies,Phase,Station,QS-Level,QS-Byte
2021,2021-02-11,42,common hazel [113],beginning of flowering [5],"Angermünde (Ph), Brandenburg [19475]",ROUTKLI validated [7],Feldwert nicht beanstandet [1]
2022,2022-01-28,28,common hazel [113],beginning of flowering [5],"Angermünde (Ph), Brandenburg [19475]",Load time checks [1],Feldwert nicht beanstandet [1]
2022,2022-01-28,28,common hazel [113],beginning of flowering [5],"Angermünde (Ph), Brandenburg [19475]",ROUTKLI validated [7],Feldwert nicht beanstandet [1]
2022,2022-03-26,85,common hazel [113],end of flowering in the observation area [41],"Angermünde (Ph), Brandenburg [19475]",ROUTKLI validated [7],Feldwert nicht beanstandet [1]
2023,2023-01-13,13,common hazel [113],beginning of flowering [5],"Angermünde (Ph), Brandenburg [19475]",Load time checks [1],Feldwert nicht beanstandet [1]
""".strip())


Expand Down

0 comments on commit d2865aa

Please sign in to comment.