Skip to content

Commit

Permalink
Fix checks for observation generation
Browse files Browse the repository at this point in the history
* Add extra check on observation ids
  • Loading branch information
hellais committed Sep 10, 2024
1 parent 945f4de commit 4b48874
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions oonipipeline/tests/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def test_write_observations(measurements, netinfodb, db):
for obs_list in measurement_to_observations(
msmt=msmt, netinfodb=netinfodb, bucket_date=bucket_date
):
# Ensure observation IDS do not clash
obs_idxs = list(map(lambda x: x.observation_idx, obs_list))
assert len(obs_idxs) == len(set(obs_idxs))
db.write_table_model_rows(obs_list)
db.close()
# Flush buffer table
Expand All @@ -232,9 +235,9 @@ def test_write_observations(measurements, netinfodb, db):
)
)
assert cnt_by_cc["CH"] == 2
assert cnt_by_cc["GR"] == 4
assert cnt_by_cc["GR"] == 20
assert cnt_by_cc["US"] == 3
assert cnt_by_cc["RU"] == 3
assert cnt_by_cc["RU"] == 47


def test_hirl_observations(measurements, netinfodb):
Expand Down

0 comments on commit 4b48874

Please sign in to comment.