Inheritance diagram for tests.test_callback_url.CallbackUrlTests:
Collaboration diagram for tests.test_callback_url.CallbackUrlTests:
Public Member Functions | |
| test_adds_a_single_slash (self) | |
| test_keeps_a_single_slash_on_the_endpoint (self) | |
| test_collapses_a_double_slash (self) | |
| test_missing_when_a_part_is_empty (self) | |
| test_accepts_the_host (self, host, expected) | |
| test_refuses_the_host (self, host) | |
| test_refuses_the_zone_or_the_text_after_the_bracket (self, host) | |
| test_checks_the_port_by_its_value (self) | |
| test_encodes_the_characters_rule_8_lists (self) | |
| test_refuses_the_zone_identifier (self, host) | |
| test_refuses_the_user_information (self, host) | |
| test_refuses_the_query_or_fragment (self, host) | |
| test_refuses_a_name_ending_in_a_number (self, host) | |
| test_refuses_the_empty_port (self, host) | |
| test_the_logged_url_holds_no_user_information (self, host, logged) | |
| test_the_invalid_url_is_the_one_built (self) | |
| test_checks_the_scheme (self) | |
| test_nothing_given_can_end_the_string (self, host) | |
| test_the_endpoint_is_encoded (self) | |
| test_refuses_the_host_outside_ascii (self, host) | |
| test_writes_a_lone_surrogate_as_the_replacement_character (self) | |
Member Function Documentation
◆ test_accepts_the_host()
| tests.test_callback_url.CallbackUrlTests.test_accepts_the_host | ( | self, | |
| host, | |||
| expected ) |
◆ test_adds_a_single_slash()
| tests.test_callback_url.CallbackUrlTests.test_adds_a_single_slash | ( | self | ) |
◆ test_checks_the_port_by_its_value()
| tests.test_callback_url.CallbackUrlTests.test_checks_the_port_by_its_value | ( | self | ) |
A port goes by its value, so leading zeros are allowed, and a port too long to read is refused rather than read as small enough.
◆ test_checks_the_scheme()
| tests.test_callback_url.CallbackUrlTests.test_checks_the_scheme | ( | self | ) |
Only http and https, ignoring the case of ASCII letters only, so a letter outside ASCII that a case-insensitive comparison can match to an ASCII one, such as the long s, is refused.
◆ test_collapses_a_double_slash()
| tests.test_callback_url.CallbackUrlTests.test_collapses_a_double_slash | ( | self | ) |
◆ test_encodes_the_characters_rule_8_lists()
| tests.test_callback_url.CallbackUrlTests.test_encodes_the_characters_rule_8_lists | ( | self | ) |
Each character rule 8 lists, after the host and in the endpoint, and a '%' without two hexadecimal digits after it, even at the end.
◆ test_keeps_a_single_slash_on_the_endpoint()
| tests.test_callback_url.CallbackUrlTests.test_keeps_a_single_slash_on_the_endpoint | ( | self | ) |
◆ test_missing_when_a_part_is_empty()
| tests.test_callback_url.CallbackUrlTests.test_missing_when_a_part_is_empty | ( | self | ) |
◆ test_nothing_given_can_end_the_string()
| tests.test_callback_url.CallbackUrlTests.test_nothing_given_can_end_the_string | ( | self, | |
| host ) |
A quote, a backslash or a line break never reaches the script, wherever in the URL it was given.
◆ test_refuses_a_name_ending_in_a_number()
| tests.test_callback_url.CallbackUrlTests.test_refuses_a_name_ending_in_a_number | ( | self, | |
| host ) |
Rule 4 reads a name whose last label is a number as an IPv4 address written as four decimal numbers, each starting with 0 only when it is 0 alone.
◆ test_refuses_the_empty_port()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_empty_port | ( | self, | |
| host ) |
Rule 5 refuses a port that is present but empty, so a protocol written into the host gives the host "https" with an empty port.
◆ test_refuses_the_host()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_host | ( | self, | |
| host ) |
◆ test_refuses_the_host_outside_ascii()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_host_outside_ascii | ( | self, | |
| host ) |
A host must be ASCII, so an internationalized name is given as A-labels, and anything else outside ASCII is refused.
◆ test_refuses_the_query_or_fragment()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_query_or_fragment | ( | self, | |
| host ) |
Rule 2 refuses a '?' or '#' anywhere in the host value.
◆ test_refuses_the_user_information()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_user_information | ( | self, | |
| host ) |
Rule 3 refuses an '@' anywhere in the host value.
◆ test_refuses_the_zone_identifier()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_zone_identifier | ( | self, | |
| host ) |
Rule 4 refuses an IPv6 zone identifier.
◆ test_refuses_the_zone_or_the_text_after_the_bracket()
| tests.test_callback_url.CallbackUrlTests.test_refuses_the_zone_or_the_text_after_the_bracket | ( | self, | |
| host ) |
Inside the brackets only an IPv6 address, optionally followed by '%25' and a zone of unreserved characters, and after them only a port. The zone check is what keeps a quote out of the script for a bracketed host.
◆ test_the_endpoint_is_encoded()
| tests.test_callback_url.CallbackUrlTests.test_the_endpoint_is_encoded | ( | self | ) |
◆ test_the_invalid_url_is_the_one_built()
| tests.test_callback_url.CallbackUrlTests.test_the_invalid_url_is_the_one_built | ( | self | ) |
◆ test_the_logged_url_holds_no_user_information()
| tests.test_callback_url.CallbackUrlTests.test_the_logged_url_holds_no_user_information | ( | self, | |
| host, | |||
| logged ) |
Rule 6 shows *** in place of everything in the host before its last '@', wherever in the host value that '@' is.
◆ test_writes_a_lone_surrogate_as_the_replacement_character()
| tests.test_callback_url.CallbackUrlTests.test_writes_a_lone_surrogate_as_the_replacement_character | ( | self | ) |
Not one of the shared cases, because only some languages' strings can hold a lone surrogate. It has no UTF-8 encoding, so it is written as U+FFFD, as a browser writes it.
