Changeset View
Changeset View
Standalone View
Standalone View
swh/icinga_plugins/tests/test_deposit.py
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | scenario.add_step( | ||||
f"{BASE_URL}/testcol/42/status/", | f"{BASE_URL}/testcol/42/status/", | ||||
status_xml, | status_xml, | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
] | ] | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | scenario.add_step( | ||||
f"{BASE_URL}/testcol/42/status/", | f"{BASE_URL}/testcol/42/status/", | ||||
status_xml, | status_xml, | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
] | ] | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | ): | ||||
) | ) | ||||
scenario.add_step("get", f"{BASE_URL}/testcol/42/status/", failed_status_xml) | scenario.add_step("get", f"{BASE_URL}/testcol/42/status/", failed_status_xml) | ||||
scenario.add_step("get", f"{BASE_URL}/testcol/42/status/", failed_status_xml) | scenario.add_step("get", f"{BASE_URL}/testcol/42/status/", failed_status_xml) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | scenario.add_step( | ||||
], | ], | ||||
) | ) | ||||
scenario.add_step("get", f"{BASE_WEB_URL}/the-metadata-url", SAMPLE_METADATA) | scenario.add_step("get", f"{BASE_WEB_URL}/the-metadata-url", SAMPLE_METADATA) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"--warning", | "--warning", | ||||
"15", | "15", | ||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | ): | ||||
scenario.add_step("get", f"{BASE_WEB_URL}/the-metadata-url", SAMPLE_METADATA) | scenario.add_step("get", f"{BASE_WEB_URL}/the-metadata-url", SAMPLE_METADATA) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--critical", | "--critical", | ||||
"50", | "50", | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
Show All 33 Lines | scenario.add_step( | ||||
status_template(status="loading"), | status_template(status="loading"), | ||||
callback=lambda: time.sleep(1500), | callback=lambda: time.sleep(1500), | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | scenario.add_step( | ||||
f"{BASE_URL}/testcol/42/status/", | f"{BASE_URL}/testcol/42/status/", | ||||
status_template(status="rejected", status_detail="booo"), | status_template(status="rejected", status_detail="booo"), | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
Show All 32 Lines | scenario.add_step( | ||||
f"{BASE_URL}/testcol/42/status/", | f"{BASE_URL}/testcol/42/status/", | ||||
status_template(status="failed", status_detail="booo"), | status_template(status="failed", status_detail="booo"), | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
Show All 33 Lines | scenario.add_step( | ||||
f"{BASE_URL}/testcol/42/status/", | f"{BASE_URL}/testcol/42/status/", | ||||
status_template(status="what", status_detail="booo"), | status_template(status="what", status_detail="booo"), | ||||
) | ) | ||||
scenario.install_mock(requests_mock) | scenario.install_mock(requests_mock) | ||||
result = invoke( | result = invoke( | ||||
[ | [ | ||||
"--prometheus-exporter", | |||||
"--prometheus-exporter-directory", | |||||
"/tmp", | |||||
"check-deposit", | "check-deposit", | ||||
*COMMON_OPTIONS, | *COMMON_OPTIONS, | ||||
"single", | "single", | ||||
"--archive", | "--archive", | ||||
sample_archive, | sample_archive, | ||||
"--metadata", | "--metadata", | ||||
sample_metadata, | sample_metadata, | ||||
], | ], | ||||
Show All 11 Lines |