-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests for oonidata using DB fixtures
- Loading branch information
Showing
7 changed files
with
61 additions
and
17 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
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,9 @@ | ||
version: '2' | ||
services: | ||
clickhouse: | ||
image: "clickhouse/clickhouse-server" | ||
ports: | ||
- "9000" | ||
volumes: | ||
- ./fixtures:/fixtures | ||
- ./fixtures/initdb:/docker-entrypoint-initdb.d/ |
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 @@ | ||
*.gz |
File renamed without changes.
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,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
gzip -dc /fixtures/obs_web-sample.sql.gz | clickhouse-client | ||
gzip -dc /fixtures/analysis_web_measurement-sample.sql.gz | clickhouse-client |
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 |
---|---|---|
@@ -1,16 +1,33 @@ | ||
def test_oonidata(client): | ||
r = client.get("api/v1/observations") | ||
r = client.get("api/v1/observations?since=2024-11-01&until=2024-11-02") | ||
j = r.json() | ||
assert isinstance(j["results"], list), j | ||
assert len(j["results"]) > 0 | ||
for result in j["results"]: | ||
assert "test_name" in result, result | ||
assert "probe_cc" in result, result | ||
|
||
r = client.get("api/v1/analysis") | ||
r = client.get("api/v1/analysis?since=2024-11-01&until=2024-11-02&probe_cc=IT") | ||
j = r.json() | ||
assert isinstance(j["results"], list), j | ||
assert len(j["results"]) > 0 | ||
for result in j["results"]: | ||
assert result["probe_cc"] == "IT" | ||
|
||
r = client.get("api/v1/aggregation/analysis") | ||
r = client.get( | ||
"api/v1/aggregation/analysis?since=2024-11-01&until=2024-11-10&probe_cc=IR" | ||
) | ||
j = r.json() | ||
assert isinstance(j["results"], list), j | ||
assert len(j["results"]) > 0 | ||
for result in j["results"]: | ||
assert result["probe_cc"] == "IR" | ||
|
||
r = client.get("api/v1/aggregation/observations") | ||
r = client.get( | ||
"api/v1/aggregation/observations?since=2024-11-01&until=2024-11-10&probe_cc=IT" | ||
) | ||
j = r.json() | ||
assert isinstance(j["results"], list), j | ||
assert len(j["results"]) > 0 | ||
for result in j["results"]: | ||
assert result["probe_cc"] == "IT" |