-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#881 fix style errors found by black
- Loading branch information
Showing
4 changed files
with
18 additions
and
19 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
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 |
---|---|---|
|
@@ -4,36 +4,36 @@ | |
def test_record_parse_simple_mailto(): | ||
TXT_RECORD = "v=TLSRPTv1; rua=mailto:[email protected]" | ||
parsed = tlsrpt_parsing.record.parseString(TXT_RECORD) | ||
assert parsed.tlsrpt_version == 'v=TLSRPTv1' | ||
assert parsed.tlsrpt_uri[0] == 'mailto:[email protected]' | ||
assert parsed.tlsrpt_version == "v=TLSRPTv1" | ||
assert parsed.tlsrpt_uri[0] == "mailto:[email protected]" | ||
|
||
|
||
def test_record_parse_multiple_mailto(): | ||
TXT_RECORD = "v=TLSRPTv1;rua=mailto:[email protected],mailto:[email protected]" | ||
parsed = tlsrpt_parsing.record.parseString(TXT_RECORD) | ||
assert parsed.tlsrpt_version == 'v=TLSRPTv1' | ||
assert parsed.tlsrpt_uri[0] == 'mailto:[email protected]' | ||
assert parsed.tlsrpt_uri[1] == 'mailto:[email protected]' | ||
assert parsed.tlsrpt_version == "v=TLSRPTv1" | ||
assert parsed.tlsrpt_uri[0] == "mailto:[email protected]" | ||
assert parsed.tlsrpt_uri[1] == "mailto:[email protected]" | ||
|
||
|
||
def test_record_parse_simple_https(): | ||
TXT_RECORD = "v=TLSRPTv1; rua=https://reporting.example.com/v1/tlsrpt" | ||
parsed = tlsrpt_parsing.record.parseString(TXT_RECORD) | ||
assert parsed.tlsrpt_version == 'v=TLSRPTv1' | ||
assert parsed.tlsrpt_uri[0] == 'https://reporting.example.com/v1/tlsrpt' | ||
assert parsed.tlsrpt_version == "v=TLSRPTv1" | ||
assert parsed.tlsrpt_uri[0] == "https://reporting.example.com/v1/tlsrpt" | ||
|
||
|
||
def test_record_parse_with_extension(): | ||
TXT_RECORD = "v=TLSRPTv1; rua=https://reporting.example.com/v1/tlsrpt; ext=extvalue" | ||
parsed = tlsrpt_parsing.record.parseString(TXT_RECORD) | ||
assert parsed.tlsrpt_version == 'v=TLSRPTv1' | ||
assert parsed.tlsrpt_version == "v=TLSRPTv1" | ||
|
||
|
||
def test_parse_silent(): | ||
""" | ||
Check that parse_silent does not throw a ParseException but instead returns | ||
None if the TLSRPT policy record is malformed. | ||
""" | ||
TXT_RECORD = "v=TLSRPTv1; rua=!!" # broken TLSRPT | ||
TXT_RECORD = "v=TLSRPTv1; rua=!!" # broken TLSRPT | ||
parsed = tlsrpt_parsing.parse_silent(TXT_RECORD) | ||
assert parsed is None |