-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type annotations for test_reporting #54
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import calendar | ||
import json | ||
from datetime import datetime | ||
from typing import Optional | ||
|
||
import requests | ||
|
||
from .models import Report | ||
from .models import Session | ||
from .utils import check_valid_uuid | ||
|
||
|
||
class ReportServiceException(Exception): | ||
pass | ||
|
||
|
||
def post_pre_scan_report(aip, start_time, report_url, report_auth=(), session_id=None): | ||
def post_pre_scan_report( | ||
aip: str, | ||
start_time: Optional[datetime], | ||
report_url: Optional[str], | ||
report_auth: Optional[str] = (), | ||
session_id: Session = None, | ||
) -> bool: | ||
""" | ||
Post a pre-scan report to a remote system. | ||
|
||
|
@@ -51,7 +61,13 @@ def post_pre_scan_report(aip, start_time, report_url, report_auth=(), session_id | |
return True | ||
|
||
|
||
def post_success_report(aip, report, report_url, report_auth=(), session_id=None): | ||
def post_success_report( | ||
aip: str, | ||
report: Optional[Report], | ||
report_url: Optional[str], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some tests are setting as report=None and report_url=None. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think if we focus on the actual use from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya let me adjust the tests which focus on the actual use of the codes. |
||
report_auth: Optional[str] = (), | ||
session_id: Session = None, | ||
) -> Optional[bool]: | ||
""" | ||
POST a JSON fixity scan report to a remote system. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these
Optional
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same argument as above 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one. :) I got your point. Let me adjust the tests.