def testParseUrl(self):
    url = atom.url.parse_url('http://www.google.com/calendar/feeds')
    self.assert_(url.protocol == 'http')
    self.assertTrue(url.port is None)
    self.assert_(url.host == 'www.google.com')
    self.assert_(url.path == '/calendar/feeds')
    self.assert_(url.params == {})

    url = atom.url.parse_url('http://example.com:6091/calendar/feeds')
    self.assert_(url.protocol == 'http')
    self.assert_(url.host == 'example.com')
    self.assert_(url.port == '6091')
    self.assert_(url.path == '/calendar/feeds')
    self.assert_(url.params == {})
    
    url = atom.url.parse_url('/calendar/feeds?foo=bar')
    self.assert_(url.protocol is None)
    self.assert_(url.host is None)
    self.assert_(url.path == '/calendar/feeds')
    self.assert_(len(url.params.keys()) == 1)
    self.assert_('foo' in url.params)
    self.assert_(url.params['foo'] == 'bar')
    
    url = atom.url.parse_url('/calendar/feeds?my+foo=bar%3Dx')
    self.assert_(len(url.params.keys()) == 1)
    self.assert_('my foo' in url.params)
    self.assert_(url.params['my foo'] == 'bar=x')
dataset/ETHPy150Open kuri65536/python-for-android/python-build/python-libs/gdata/tests/atom_tests/url_test.py/UrlTest.testParseUrl/original