Skip to main content
Glama

URL Reputation and Validity Checker

by prismon
test_extractors.cpython-313-pytest-8.3.5.pyc42.6 kB
� ��7h�+��J�SrSSKrSSKJs Jr SSKrSSKJ r "SS5r g)zUnit tests for extractors.py�N�� LinkExtractorc���\rSrSrSr\R S5rSrSr Sr Sr Sr S r S rS rS rS rSrSrSrSrSrSrSrSrSrSrSrSrSrg)�TestLinkExtractor�zTest suite for LinkExtractor.c��[5$)z Create a LinkExtractor instance.r)�selfs �L/home/josh/Projects/reputation-and-validity-checker/tests/test_extractors.py� extractor�TestLinkExtractor.extractor s �����c�L�SnURUSS9n[U5nSoTU:Hof(Gd [R"SU4SXE45S[R "5;d[R "[5(a[R"[5OSS[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5S .-nS S U0-n[[R"U55eS =n=peS o�U;oD(d�[R"SU4SX�45[R"U 5S[R "5;d[R "U5(a[R"U5OSS.-n SSU 0-n [[R"U 55eS =p�So�U;oD(d�[R"SU4SX�45[R"U 5S[R "5;d[R "U5(a[R"U5OSS.-n SSU 0-n [[R"U 55eS =p�g )z Test basic HTML link extraction.z� <html> <body> <a href="https://example.com">Example</a> <a href="https://test.com">Test</a> </body> </html> �html�� content_type���==�z0%(py3)s {%(py3)s = %(py0)s(%(py1)s) } == %(py6)s�len�links��py0�py1�py3�py6�assert %(py8)s�py8N�https://example.com��in�z%(py1)s in %(py3)s�rr�assert %(py5)s�py5�https://test.com� � extract_linksr� @pytest_ar�_call_reprcompare� @py_builtins�locals�_should_repr_global_name� _saferepr�AssertionError�_format_explanation� r r rr� @py_assert2� @py_assert5� @py_assert4� @py_format7� @py_format9� @py_assert0� @py_format4� @py_format6s r �test_extract_links_html_basic�/TestLinkExtractor.test_extract_links_html_basicsj�� ���'�'��6�'�B���5�z��Q��Q������z�������s�����s�������5�����5����z����Q��������$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-�!�*�U�*�*�*�*�*�!�*�*�*�!�*�*�*�*�*�*�U�*�*�*�*�U�*�*�*�*�*�*�*r c���SnURUSS9n1Skn[U5oUU:Hof(GdC[R"SU4SXT45S[R "5;d[R "[5(a[R"[5OSS[R "5;d[R "U5(a[R"U5OS[R"U5S [R "5;d[R "U5(a[R"U5OS S .-nS S U0-n[[R"U55eS =pVg )z+Test extraction from various HTML elements.a� <html> <head> <link rel="stylesheet" href="https://example.com/style.css"> <script src="https://example.com/script.js"></script> <meta http-equiv="refresh" content="0; url=https://example.com/redirect"> </head> <body> <a href="https://example.com/page">Link</a> <img src="https://example.com/photo.jpg" alt="Photo"> </body> </html> rr>�https://example.com/page�https://example.com/redirect�https://example.com/photo.jpg�https://example.com/script.js�https://example.com/style.cssr)z0%(py3)s {%(py3)s = %(py0)s(%(py1)s) } == %(py5)s�setr�expected_links)rrrr%zassert %(py7)s�py7N) r(rBr)r*r+r,r-r.r/r0) r r rrrCr2r4r9� @py_format8s r �(test_extract_links_html_various_elements�:TestLinkExtractor.test_extract_links_html_various_elements s���  ���'�'��6�'�B�� ���5�z�+�^�+�+�+�+�+�z�+�+�+�+�+�+�s�+�+�+�+�s�+�+�+�+�+�+�5�+�+�+�+�5�+�+�+�z�+�+�+�+�+�+�^�+�+�+�+�^�+�+�+�+�+�+�+r c�b�SnURUSSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS .-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS .-nS S U0-n[[R"U55eS =pESoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS .-nS S U0-n[[R"U55eS =pEg )z(Test HTML link extraction with base URL.z� <html> <body> <a href="/page">Relative</a> <a href="page.html">Same level</a> <a href="https://example.com">Absolute</a> </body> </html> rzhttps://base.com/)r�base_urlzhttps://base.com/pager r"rr#r$r%Nzhttps://base.com/page.htmlr� r(r)r*r.r+r,r-r/r0�r r rrr7r2r8r9s r �%test_extract_links_html_with_base_url�7TestLinkExtractor.test_extract_links_html_with_base_url<s:�� ���'�'��6�L_�'�`��&�/�%�/�/�/�/�/�&�/�/�/�&�/�/�/�/�/�/�%�/�/�/�/�%�/�/�/�/�/�/�/�+�4�u�4�4�4�4�4�+�4�4�4�+�4�4�4�4�4�4�u�4�4�4�4�u�4�4�4�4�4�4�4�$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-r c�L�SnURUSS9n[U5nSoTU:Hof(Gd [R"SU4SXE45S[R "5;d[R "[5(a[R"[5OSS[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5S .-nS S U0-n[[R"U55eS =n=peS o�U;oD(d�[R"SU4SX�45[R"U 5S[R "5;d[R "U5(a[R"U5OSS.-n SSU 0-n [[R"U 55eS =p�So�U;oD(d�[R"SU4SX�45[R"U 5S[R "5;d[R "U5(a[R"U5OSS.-n SSU 0-n [[R"U 55eS =p�g )z Test basic text link extraction.za Check out https://example.com for more info. Also visit http://test.com �textrrrrrrrrrNrr r"r#r$r%�http://test.comr') r r rOrr2r3r4r5r6r7r8r9s r �test_extract_links_text_basic�/TestLinkExtractor.test_extract_links_text_basicNsj�� �� �'�'��6�'�B���5�z��Q��Q������z�������s�����s�������5�����5����z����Q��������$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-� �)�E�)�)�)�)�)� �)�)�)� �)�)�)�)�)�)�E�)�)�)�)�E�)�)�)�)�)�)�)r c���SnURUSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pEg ) z-Test extraction from Markdown formatted text.z} Here's a [link to example](https://example.com). Another [test link](http://test.com "Test Title"). rOrrr r"rr#r$r%NrPrJ�r r rOrr7r2r8r9s r � test_extract_links_text_markdown�2TestLinkExtractor.test_extract_links_text_markdown[���� �� �'�'��6�'�B��$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-� �)�E�)�)�)�)�)� �)�)�)� �)�)�)�)�)�)�E�)�)�)�)�E�)�)�)�)�)�)�)r c���SnURUSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pEg ) zTest extraction of quoted URLs.zY The URL is "https://example.com" Another one: 'http://test.com' rOrrr r"rr#r$r%NrPrJrTs r �test_extract_links_text_quoted�0TestLinkExtractor.test_extract_links_text_quotedgrWr c��SnURU5nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nSSU0-n[[R"U55eS =pEg ) z$Test auto-detection of HTML content.z} <html> <body> <a href="https://example.com">Example</a> </body> </html> rr r"rr#r$r%NrJrKs r �#test_extract_links_auto_detect_html�5TestLinkExtractor.test_extract_links_auto_detect_htmlssx�� ���'�'��-��$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-r c��SnURU5nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nSSU0-n[[R"U55eS =pEg ) z$Test auto-detection of text content.z(Just plain text with https://example.comrr r"rr#r$r%NrJrTs r �#test_extract_links_auto_detect_text�5TestLinkExtractor.test_extract_links_auto_detect_text�sv��9���'�'��-��$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-r c�F�SnURU5nURnSoT"U5nSovU:Ho�(d�[R"SU4SXg45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-n SS U 0-n [[R"U 55eS =n=n=n=p�g ) z&Test that duplicate links are removed.z� <a href="https://example.com">Link 1</a> <a href="https://example.com">Link 2</a> Text with https://example.com again r�r)zK%(py6)s {%(py6)s = %(py2)s {%(py2)s = %(py0)s.count }(%(py4)s) } == %(py9)sr�r�py2�py4r�py9�assert %(py11)s�py11N) r(�countr)r*r+r,r-r.r/r0) r r rr� @py_assert1� @py_assert3r3� @py_assert8� @py_assert7� @py_format10� @py_format12s r �$test_extract_links_duplicate_removal�6TestLinkExtractor.test_extract_links_duplicate_removal�s��� �� �'�'��-���{�{�6�0�6�{�0�1�6�Q�6�Q�6�6�6�6�6�1�6�6�6�6�6�6�u�6�6�6�6�u�6�6�6�{�6�6�6�0�6�6�6�1�6�6�6�Q�6�6�6�6�6�6�6�6r c���SnURUSS9n[U5nSoTU:Hof(Gd [R"SU4SXE45S[R "5;d[R "[5(a[R"[5OSS[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5S .-nS S U0-n[[R"U55eS =n=peS o�U;oD(d�[R"SU4SX�45[R"U 5S[R "5;d[R "U5(a[R"U5OSS.-n SSU 0-n [[R"U 55eS =p�g )z(Test that invalid URLs are filtered out.a <a href="">Empty</a> <a href="javascript:void(0)">JavaScript</a> <a href="mailto:test@example.com">Email</a> <a href="tel:+1234567890">Phone</a> <a href="#anchor">Anchor</a> <a href="https://example.com">Valid</a> rrrbrrrrrrrNrr r"r#r$r%r'r1s r �(test_extract_links_invalid_urls_filtered�:TestLinkExtractor.test_extract_links_invalid_urls_filtered�s�� ���'�'��6�'�B���5�z��Q��Q������z�������s�����s�������5�����5����z����Q��������$�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-r c���SnURUSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pEg ) z'Test extraction from meta refresh tags.z� <html> <head> <meta http-equiv="refresh" content="0; url=https://example.com/redirect"> <meta http-equiv="refresh" content="5;url='https://test.com'"> </head> </html> rrr>r r"rr#r$r%Nr&rJrKs r �test_extract_links_meta_refresh�1TestLinkExtractor.test_extract_links_meta_refresh�s��� ���'�'��6�'�B��-�6��6�6�6�6�6�-�6�6�6�-�6�6�6�6�6�6��6�6�6�6��6�6�6�6�6�6�6�!�*�U�*�*�*�*�*�!�*�*�*�!�*�*�*�*�*�*�U�*�*�*�*�U�*�*�*�*�*�*�*r c��SnURUSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pEg ) z$Test extraction from malformed HTML.z� <html> <body> <a href="https://example.com">Valid link <a href="https://test.com" rrrr r"rr#r$r%NrJrKs r �!test_extract_links_malformed_html�3TestLinkExtractor.test_extract_links_malformed_html�s�� ���'�'��6�'�B��%�-��-�-�-�-�-�$�-�-�-�$�-�-�-�-�-�-��-�-�-�-��-�-�-�-�-�-�-r c�X�URnSo2"U5nSoTU:Hof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nSoTU:Hof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nSoTU:Hof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peg ) z%Test content type detection for HTML.z<html>content</html>rr�zZ%(py6)s {%(py6)s = %(py2)s {%(py2)s = %(py0)s._detect_content_type }(%(py4)s) } == %(py9)sr rcrgrhNz<body>content</body>z<a href="test">link</a>� �_detect_content_typer)r*r+r,r-r.r/r0� r r rjrkr3rlrmrnros r �test_detect_content_type_html�/TestLinkExtractor.test_detect_content_type_html�s����-�-�O�.D�O�-�.D�E�O��O��O�O�O�O�O�E�O�O�O�O�O�O�y�O�O�O�O�y�O�O�O�-�O�O�O�.D�O�O�O�E�O�O�O��O�O�O�O�O�O�O��-�-�O�.D�O�-�.D�E�O��O��O�O�O�O�O�E�O�O�O�O�O�O�y�O�O�O�O�y�O�O�O�-�O�O�O�.D�O�O�O�E�O�O�O��O�O�O�O�O�O�O��-�-�R�.G�R�-�.G�H�R�F�R�F�R�R�R�R�R�H�R�R�R�R�R�R�y�R�R�R�R�y�R�R�R�-�R�R�R�.G�R�R�R�H�R�R�R�F�R�R�R�R�R�R�R�Rr c�<�URnSo2"U5nSoTU:Hof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nSoTU:Hof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peg ) z%Test content type detection for text.zJust plain textrOrr|r rcrgrhNzNo HTML tags herer}rs r �test_detect_content_type_text�/TestLinkExtractor.test_detect_content_type_text�s?���-�-�J�.?�J�-�.?�@�J�F�J�F�J�J�J�J�J�@�J�J�J�J�J�J�y�J�J�J�J�y�J�J�J�-�J�J�J�.?�J�J�J�@�J�J�J�F�J�J�J�J�J�J�J��-�-�L�.A�L�-�.A�B�L�f�L�f�L�L�L�L�L�B�L�L�L�L�L�L�y�L�L�L�L�y�L�L�L�-�L�L�L�.A�L�L�L�B�L�L�L�f�L�L�L�L�L�L�L�Lr c��URnSo2"U5nSoTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nSoTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nS oTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnS o2"U5nS oTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnSo2"U5nS oTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnSo2"U5nS oTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peURnSo2"U5nS oTULof(d�[R"SU4SXE45S[R"5;d[R "U5(a[R "U5OS[R "U5[R "U5[R "U5[R "U5S.-nSSU0-n[[R"U55eS =n=n=n=peg )zTest link validation.rT��is)zT%(py6)s {%(py6)s = %(py2)s {%(py2)s = %(py0)s._is_valid_link }(%(py4)s) } is %(py9)sr rcrgrhNrP�Fzjavascript:void(0)zmailto:test@example.comz#anchorzftp://example.com) �_is_valid_linkr)r*r+r,r-r.r/r0rs r �test_is_valid_link�$TestLinkExtractor.test_is_valid_link�sN���'�'�F�(=�F�'�(=�>�F�$�F�$�F�F�F�F�F�>�F�F�F�F�F�F�y�F�F�F�F�y�F�F�F�'�F�F�F�(=�F�F�F�>�F�F�F�$�F�F�F�F�F�F�F��'�'�B�(9�B�'�(9�:�B�d�B�d�B�B�B�B�B�:�B�B�B�B�B�B�y�B�B�B�B�y�B�B�B�'�B�B�B�(9�B�B�B�:�B�B�B�d�B�B�B�B�B�B�B��'�'�4��4�'��+�4�u�4�u�4�4�4�4�4�+�4�4�4�4�4�4�y�4�4�4�4�y�4�4�4�'�4�4�4��4�4�4�+�4�4�4�u�4�4�4�4�4�4�4��'�'�F�(<�F�'�(<�=�F��F��F�F�F�F�F�=�F�F�F�F�F�F�y�F�F�F�F�y�F�F�F�'�F�F�F�(<�F�F�F�=�F�F�F��F�F�F�F�F�F�F��'�'�K�(A�K�'�(A�B�K�e�K�e�K�K�K�K�K�B�K�K�K�K�K�K�y�K�K�K�K�y�K�K�K�'�K�K�K�(A�K�K�K�B�K�K�K�e�K�K�K�K�K�K�K��'�'�;� �;�'� �2�;�e�;�e�;�;�;�;�;�2�;�;�;�;�;�;�y�;�;�;�;�y�;�;�;�'�;�;�;� �;�;�;�2�;�;�;�e�;�;�;�;�;�;�;��'�'�E�(;�E�'�(;�<�E��E��E�E�E�E�E�<�E�E�E�E�E�E�y�E�E�E�E�y�E�E�E�'�E�E�E�(;�E�E�E�<�E�E�E��E�E�E�E�E�E�E�Er c��/SQnURU5n/SQnX4:HoU(d�[R"SU4SX445S[R"5;d[R "U5(a[R "U5OSS[R"5;d[R "U5(a[R "U5OSS.-nSS U0-n[[R"U55eS ng ) z!Test domain extraction from URLs.)r=z#https://subdomain.example.com/otherzhttp://test.com:8080/pathzhttps://another.org)z another.org� example.comzsubdomain.example.com�test.comr)z%(py0)s == %(py2)s�domains�expected_domains)rrdzassert %(py4)sreN� �extract_domainsr)r*r+r,r-r.r/r0)r r �urlsr�r�rj� @py_format3� @py_format5s r �test_extract_domains�&TestLinkExtractor.test_extract_domains�s��� ���+�+�D�1��^���*�*�*�*�*�w�*�*�*�*�*�*�w�*�*�*�*�w�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*r c��/SQnURU5nSS/oCU:HoU(d�[R"SU4SX445S[R"5;d[R "U5(a[R "U5OS[R "U5S.-nSS U0-n[[R"U55eS =pTg ) z+Test domain extraction with duplicate URLs.)zhttps://example.com/page1zhttps://example.com/page2zhttps://EXAMPLE.COM/page3r&r�r�r�z%(py0)s == %(py3)sr��rrr$r%Nr��r r r�r�r2rjr8r9s r �test_extract_domains_duplicates�1TestLinkExtractor.test_extract_domains_duplicates�s}�� ���+�+�D�1��(�*�5�5�5�5�5�5�5�5�w�5�5�5�5�5�5�w�5�5�5�5�w�5�5�5�5�5�5�5�5�5�5�5r c��/SQnURU5nSS/oCU:HoU(d�[R"SU4SX445S[R"5;d[R "U5(a[R "U5OS[R "U5S.-nSS U0-n[[R"U55eS =pTg ) z)Test domain extraction with invalid URLs.)rz not-a-urlzhttp://r&r�r�rr�r�r�r$r%Nr�r�s r �!test_extract_domains_invalid_urls�3TestLinkExtractor.test_extract_domains_invalid_urls�s�� ���+�+�D�1��)�*�5�5�5�5�5�5�5�5�w�5�5�5�5�5�5�w�5�5�5�5�w�5�5�5�5�5�5�5�5�5�5�5r c��SnURUSS9n/SQoCU:HoU(d�[R"SU4SX445S[R"5;d[R "U5(a[R "U5OS[R "U5S.-nS S U0-n[[R"U55eS =pTg ) z"Test that output links are sorted.z� <a href="https://zebra.com">Z</a> <a href="https://apple.com">A</a> <a href="https://banana.com">B</a> rr)zhttps://apple.comzhttps://banana.comzhttps://zebra.comrr�rr�r$r%N) r(r)r*r+r,r-r.r/r0)r r rrr2rjr8r9s r � test_extract_links_sorted_output�2TestLinkExtractor.test_extract_links_sorted_outputs}�� �� �'�'��6�'�B��X�X�X�X�X�X�X�X�u�X�X�X�X�X�X�u�X�X�X�X�u�X�X�X�X�X�X�X�X�X�X�Xr c�`�SnURUSS9nSoDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pES oDU;oU(d�[R"SU4SXC45[R"U5S[R "5;d[R "U5(a[R"U5OSS.-nS S U0-n[[R"U55eS =pEg )z Test extraction of complex URLs.z� https://example.com/path?query=value&other=123 https://test.com:8080/api/v1/users https://subdomain.example.org/path/to/page#section rOrz.https://example.com/path?query=value&other=123r r"rr#r$r%Nz"https://test.com:8080/api/v1/usersz2https://subdomain.example.org/path/to/page#sectionrJrTs r �test_extract_links_complex_urls�1TestLinkExtractor.test_extract_links_complex_urlss7�� �� �'�'��6�'�B��?�H�5�H�H�H�H�H�?�H�H�H�?�H�H�H�H�H�H�5�H�H�H�H�5�H�H�H�H�H�H�H�3�<�u�<�<�<�<�<�3�<�<�<�3�<�<�<�<�<�<�u�<�<�<�<�u�<�<�<�<�<�<�<�C�L�u�L�L�L�L�L�C�L�L�L�C�L�L�L�L�L�L�u�L�L�L�L�u�L�L�L�L�L�L�Lr c� �URnURnSoC"U5nSoeULow(d�[R"SU4SXV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"SU4SXV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"SU4SXV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"S U4S XV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnSoC"U5nSoeULow(d�[R"S U4S XV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvg)zTest the URL pattern regex.rN��is not�zP%(py6)s {%(py6)s = %(py2)s {%(py2)s = %(py0)s.search }(%(py4)s) } is not %(py9)s�patternrcrgrhzhttp://test.co.ukzhttps://sub.domain.com/pathzhttps://r��zL%(py6)s {%(py6)s = %(py2)s {%(py2)s = %(py0)s.search }(%(py4)s) } is %(py9)sr�) � URL_PATTERN�searchr)r*r+r,r-r.r/r0� r r r�rjrkr3rlrmrnros r �$test_extract_links_url_pattern_regex�6TestLinkExtractor.test_extract_links_url_pattern_regex"s ���'�'���~�~�@�3�@�~�3�4�@�D�@�D�@�@�@�@�@�4�@�@�@�@�@�@�w�@�@�@�@�w�@�@�@�~�@�@�@�3�@�@�@�4�@�@�@�D�@�@�@�@�@�@�@��~�~�>�1�>�~�1�2�>�$�>�$�>�>�>�>�>�2�>�>�>�>�>�>�w�>�>�>�>�w�>�>�>�~�>�>�>�1�>�>�>�2�>�>�>�$�>�>�>�>�>�>�>��~�~�H�;�H�~�;�<�H�D�H�D�H�H�H�H�H�<�H�H�H�H�H�H�w�H�H�H�H�w�H�H�H�~�H�H�H�;�H�H�H�<�H�H�H�D�H�H�H�H�H�H�H��~�~�1�j�1�~�j�)�1�T�1�T�1�1�1�1�1�)�1�1�1�1�1�1�w�1�1�1�1�w�1�1�1�~�1�1�1�j�1�1�1�)�1�1�1�T�1�1�1�1�1�1�1��~�~�4�m�4�~�m�,�4��4��4�4�4�4�4�,�4�4�4�4�4�4�w�4�4�4�4�w�4�4�4�~�4�4�4�m�4�4�4�,�4�4�4��4�4�4�4�4�4�4�4r c��URnURnSoC"U5nSoeULow(d�[R"SU4SXV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"SU4SXV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"S U4S XV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvURnS oC"U5nSoeULow(d�[R"S U4S XV45S[R "5;d[R "U5(a[R"U5OS[R"U5[R"U5[R"U5[R"U5S.-nSSU0-n [[R"U 55eS=n=n=n=pvg)z Test the Markdown pattern regex.zext](https://example.com)Nr�r�r�rcrgrhz[link text](http://test.com)z[text]r�r�z(url)) �MARKDOWN_PATTERNr�r)r*r+r,r-r.r/r0r�s r �)test_extract_links_markdown_pattern_regex�;TestLinkExtractor.test_extract_links_markdown_pattern_regex0sr���,�,���~�~�H�;�H�~�;�<�H�D�H�D�H�H�H�H�H�<�H�H�H�H�H�H�w�H�H�H�H�w�H�H�H�~�H�H�H�;�H�H�H�<�H�H�H�D�H�H�H�H�H�H�H��~�~�I�<�I�~�<�=�I�T�I�T�I�I�I�I�I�=�I�I�I�I�I�I�w�I�I�I�I�w�I�I�I�~�I�I�I�<�I�I�I�=�I�I�I�T�I�I�I�I�I�I�I��~�~�/�h�/�~�h�'�/�4�/�4�/�/�/�/�/�'�/�/�/�/�/�/�w�/�/�/�/�w�/�/�/�~�/�/�/�h�/�/�/�'�/�/�/�4�/�/�/�/�/�/�/��~�~�.�g�.�~�g�&�.�$�.�$�.�.�.�.�.�&�.�.�.�.�.�.�w�.�.�.�.�w�.�.�.�~�.�.�.�g�.�.�.�&�.�.�.�$�.�.�.�.�.�.�.�.r �N)�__name__� __module__� __qualname__�__firstlineno__�__doc__�pytest�fixturer r:rFrLrQrUrYr\r_rprsrvryr�r�r�r�r�r�r�r�r�r��__static_attributes__r�r r rrs���'� �^�^����+�",�8.�$ *� *� *� .�.� 7�.�"+� .�S� M� F� +� 6� 6� Y� M� 5� /r r) r��builtinsr+�_pytest.assertion.rewrite� assertion�rewriter)r��!url_reputation_checker.extractorsrrr�r r �<module>r�s��"��� �;�s/�s/r

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prismon/reputation-checker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server