Example #1
0
    def test_get_formatted_locations_basic_auth(self) -> None:
        """
        Test that basic authentication credentials defined in URL
        is not included in formatted output.
        """
        index_urls = [
            "https://pypi.org/simple",
            "https://*****:*****@repo.domain.com",
        ]
        find_links = ["https://*****:*****@page.domain.com"]
        search_scope = SearchScope(
            find_links=find_links,
            index_urls=index_urls,
        )

        result = search_scope.get_formatted_locations()
        assert "repo-user:****@repo.domain.com" in result
        assert "repo-pass" not in result
        assert "links-user:****@page.domain.com" in result
        assert "links-pass" not in result