Skip to content

Commit

Permalink
Cleanup tests and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
funilrys committed Mar 26, 2024
1 parent e4802eb commit b9a1947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions PyFunceble/checker/availability/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,16 +919,7 @@ def try_to_query_status_from_http_status_code(
if from_domain_test and self.status.url_syntax:
return self

if not self.status.url_syntax and not RegexHelper("[^a-z0-9._]").match(
self.idna_subject, return_match=False
):
# The regex is there because while testing for domain, sometime we
# may see something like mailto:[email protected]

self.http_status_code_query_tool.set_subject(
f"http://{self.idna_subject}:80"
)
elif not self.idna_subject.startswith("http"):
if not self.status.url_syntax and not self.idna_subject.startswith("http"):
self.http_status_code_query_tool.set_subject(
f"http://{self.idna_subject}:80"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/checker/availability/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ def test_try_to_query_status_from_http_status_code(self) -> None:

self.checker.try_to_query_status_from_http_status_code()

expected_subject = "mailto:[email protected]"
expected_subject = "http://mailto:[email protected]:80"
actual_subject = self.checker.http_status_code_query_tool.subject

self.assertEqual(expected_subject, actual_subject)
Expand Down

0 comments on commit b9a1947

Please sign in to comment.