Skip to content

Commit

Permalink
added two tests to bring coverage to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
wiggzz committed Jan 2, 2015
1 parent 529d32e commit fbf68a9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/tests-unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ def test_read_limit(self):

self.assertEqual(len(buf1), 10)

def test_read_zero(self):
s1 = RandomIO.RandomIO('seed string')

b = s1.read(0)

self.assertEqual(len(b), 0)

def test_seek_beginning(self):
s1 = RandomIO.RandomIO('seed string')

Expand Down Expand Up @@ -214,6 +221,14 @@ def test_tell_seek_parity(self):
p = s1.tell()

self.assertEqual(p, 100)

def test_seek_end_not_possible(self):
s1 = RandomIO.RandomIO('seed string')

with self.assertRaises(RuntimeError) as ex:
s1.seek(100,os.SEEK_END)

self.assertEqual(str(ex.exception), 'Cannot seek from end of stream if size is unknown.')

def test_iotools_txt(self):
output = 'txt_test.out'
Expand Down

0 comments on commit fbf68a9

Please sign in to comment.