def test_with_hostname_replaces_hostname(self): url = URL('https://*****:*****@github.com/') assert (url.with_hostname('example.com') == 'https://*****:*****@example.com/')