def test_basic_url(): url = "http://www.linkedin.com/in/andrewmontalenti" parsed_url = url_parse(url) assert parsed_url["scheme"] == "http://" assert parsed_url["host"] == "www.linkedin.com" assert parsed_url["path"] == "/in/andrewmontalenti" assert parsed_url["port"] == 80 assert parsed_url["fragment"] is None assert parsed_url["query"] is None
def test_advanced_url(): url = "http://www.linkedin.com/profile/view?id=13836198&trk=ppro_viewmore#more-123" parsed_url = url_parse(url) assert parsed_url["fragment"] == "#more-123" assert parsed_url["query"] == "?id=13836198&trk=ppro_viewmore"