Skip to content

Commit

Permalink
updated testing for report submitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen2x committed May 16, 2022
1 parent 41a50e1 commit 0ac425f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
4 changes: 4 additions & 0 deletions ga4gh/testbed/submit/report_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def submit_report(series_id, series_token, report:Report, url="http://localhost:
report - GA4GH report object
url - URL of the testbed server
'''

if type(report) != Report:
raise Exception()

header = {"GA4GH-TestbedReportSeriesId": series_id, "GA4GH-TestbedReportSeriesToken": series_token}
submit_request = requests.post(url, headers=header ,json=json.loads(report.to_json()))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest
from ga4gh.testbed.submit.report_submitter import ReportSubmitter
from ga4gh.testbed.report.report import Report

sample_report = {"schema_name":"ga4gh-testbed-report","schema_version":"0.1.0","testbed_name":"refget-compliance-suite","testbed_version":"","testbed_description":"","platform_name":"","platform_description":"","input_parameters":{},"start_time":"2022-03-22T17:45:37Z","end_time":"2022-03-22T17:46:32Z","status":"PASS","summary":{"unknown":0,"passed":49,"warned":0,"failed":0,"skipped":20},"phases":[]}
sample_report = Report()

submit_report_inputs = "series_id,series_token,report,url,status_code"
submit_report_cases = [
Expand All @@ -19,20 +20,20 @@
"http://localhost:4500/reports",
200
),
(
"1edb5213-52a2-434f-a7b8-b101fea8fb30",
"K5pLbwScVu8rEoLLj8pRy5Wv7EXTVahn",
"",
"http://localhost:4500/reports",
400
),
(
"1edb5213-52a2-434f-a7b8-b101fea8fb30",
"K5pLbwScVu8rEoLLj8pRy5Wv7EXTVahn",
{},
"http://localhost:4500/reports",
500
),
#(
# "1edb5213-52a2-434f-a7b8-b101fea8fb30",
# "K5pLbwScVu8rEoLLj8pRy5Wv7EXTVahn",
# "",
# "http://localhost:4500/reports",
# 400
#),
#(
# "1edb5213-52a2-434f-a7b8-b101fea8fb30",
# "K5pLbwScVu8rEoLLj8pRy5Wv7EXTVahn",
# {},
# "http://localhost:4500/reports",
# 500
#),
(
"",
"K5pLbwScVu8rEoLLj8pRy5Wv7EXTVahn",
Expand Down

0 comments on commit 0ac425f

Please sign in to comment.