source: uri/tests/UriTest.py@ 237

Last change on this file since 237 was 233, checked in by wouter, 4 years ago

rename ur.py to uri.py

File size: 979 bytes
RevLine 
[231]1import unittest
[233]2from uri import URI
[231]3
4class OfferTest (unittest.TestCase) :
5 u1=URI("http://blabla")
[232]6 u1a=URI("hTTP://blaBla")
[231]7 u2=URI("ws://localhost:8080/bla/2/3?q=hello#zozo")
8
9 def testGetUri(self):
10 self.assertEqual("ws://localhost:8080/bla/2/3?q=hello#zozo", self.u2.getUri())
11
12 def testRepr(self):
13 self.assertEqual("ws://localhost:8080/bla/2/3?q=hello#zozo", repr(self.u2))
14
15 def testGetHost(self):
16 self.assertEqual("localhost", self.u2.getHost())
17
18 def testGetScheme(self):
19 self.assertEqual("ws", self.u2.getScheme())
20
21 def testGetFragment(self):
22 self.assertEqual("zozo", self.u2.getFragment())
23
24 def testGetQuery(self):
25 self.assertEqual("q=hello", self.u2.getQuery())
[232]26
27 def testHashEq(self):
28 self.assertEqual(self.u1, self.u1a)
29 self.assertEqual(hash(self.u1), hash(self.u1a))
30
Note: See TracBrowser for help on using the repository browser.