Added some tests for defaults
added test_miniuri.py
This commit is contained in:
parent
79707d1786
commit
671ecd408a
1 changed files with 49 additions and 0 deletions
49
test_miniuri.py
Normal file
49
test_miniuri.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
from unittest import TestCase
|
||||
|
||||
from miniuri import Uri
|
||||
|
||||
class TestMiniUri(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# "http://www.foxhop.net/samsung/HL-T5087SA/red-LED-failure"
|
||||
self.u = Uri('https://fox:pass@www.foxhop.net:81/path/filename.jpg?p=2#5')
|
||||
|
||||
def test_uri(self):
|
||||
self.assertEqual(self.u.uri, 'https://fox:pass@www.foxhop.net:81/path/filename.jpg?p=2#5')
|
||||
|
||||
def test_scheme(self):
|
||||
self.assertEqual(self.u.scheme, 'https')
|
||||
|
||||
def test_authority(self):
|
||||
self.assertEqual(self.u.authority, 'fox:pass@www.foxhop.net:81')
|
||||
|
||||
def test_authority(self):
|
||||
self.assertEqual(self.u.userinfo, 'fox:pass')
|
||||
|
||||
def test_username(self):
|
||||
self.assertEqual(self.u.username, 'fox')
|
||||
|
||||
def test_password(self):
|
||||
self.assertEqual(self.u.password, 'pass')
|
||||
|
||||
def test_hostname(self):
|
||||
self.assertEqual(self.u.hostname, 'www.foxhop.net')
|
||||
|
||||
def test_port(self):
|
||||
self.assertEqual(self.u.port, '81')
|
||||
|
||||
def test_path(self):
|
||||
self.assertEqual(self.u.path, '/path/filename.jpg')
|
||||
|
||||
def test_filename(self):
|
||||
self.assertEqual(self.u.filename, 'filename.jpg')
|
||||
|
||||
def test_extension(self):
|
||||
self.assertEqual(self.u.extension, 'jpg')
|
||||
|
||||
def test_query(self):
|
||||
self.assertEqual(self.u.query, 'p=2')
|
||||
|
||||
def test_fragment(self):
|
||||
self.assertEqual(self.u.fragment, '5')
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue