File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1681,7 +1681,11 @@ def assert_link_status_code_is_not_404(self, link):
1681
1681
def assert_no_404_errors (self , multithreaded = True ):
1682
1682
""" Assert no 404 errors from page links obtained from:
1683
1683
"a"->"href", "img"->"src", "link"->"href", and "script"->"src". """
1684
- links = self .get_unique_links ()
1684
+ all_links = self .get_unique_links ()
1685
+ links = []
1686
+ for link in all_links :
1687
+ if "javascript:" not in link and "mailto:" not in link :
1688
+ links .append (link )
1685
1689
if multithreaded :
1686
1690
from multiprocessing .dummy import Pool as ThreadPool
1687
1691
pool = ThreadPool (10 )
@@ -1690,12 +1694,10 @@ def assert_no_404_errors(self, multithreaded=True):
1690
1694
pool .join ()
1691
1695
else :
1692
1696
for link in links :
1693
- if "javascript:" not in link : # Ignore links with JavaScript
1694
- self .assert_link_status_code_is_not_404 (link )
1697
+ self .assert_link_status_code_is_not_404 (link )
1695
1698
if self .demo_mode :
1696
1699
messenger_post = ("ASSERT NO 404 ERRORS" )
1697
- js_utils .post_messenger_success_message (
1698
- self .driver , messenger_post , self .message_duration )
1700
+ self .__highlight_with_assert_success (messenger_post , "html" )
1699
1701
1700
1702
def print_unique_links_with_status_codes (self ):
1701
1703
""" Finds all unique links in the html of the page source
You can’t perform that action at this time.
0 commit comments