Example #1
0
 def test_http_no_path_no_endslash(self):
     url = nw.URL('http://server.com')
     self.assertEqual(url.protocol, 'http')
     self.assertEqual(url.host, 'server.com')
     self.assertEqual(url.request, '/')
     self.assertEqual(url.path, '')
     self.assertEqual(url.filename, '')
Example #2
0
 def test_http_with_path_with_endslash(self):
     url = nw.URL('http://server.com/path/to/file/')
     self.assertEqual(url.protocol, 'http')
     self.assertEqual(url.host, 'server.com')
     self.assertEqual(url.request, '/path/to/file/')
     self.assertEqual(url.path, 'path/to/file')
     self.assertEqual(url.filename, '')
Example #3
0
 def test_http_no_path_no_endslash_with_digits_only(self):
     url = nw.URL('http://123.com')
     self.assertEqual(url.protocol, 'http')
     self.assertEqual(url.host, '123.com')
     self.assertEqual(url.request, '/')
     self.assertEqual(url.path, '')
     self.assertEqual(url.filename, '')