示例#1
0
 def test_write_bytes_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(bytes('my_history',
                              sys.getfilesystemencoding()),
                        raise_exc=True)
     self.assertTrue(isfile('my_history'))
示例#2
0
 def setUp(self):
     reset()
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     history.append('pebbles')
示例#3
0
 def test_replace(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[2] = 'dino'
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[0] = 'hopper'
     self.assertEqual(history[0], 'hopper')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[-1] = 'bedrock'
     self.assertEqual(history[0], 'hopper')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bedrock')
示例#4
0
 def test_read_tilde_expanded(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(self.histfile, raise_exc=True)
     history.clear()
     history.read_file('~/.history', raise_exc=True)
     self.assertEqual(len(history), 2)
示例#5
0
 def test_read_default_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(self.histfile, raise_exc=True)
     history.clear()
     history.read_file(raise_exc=True)
     self.assertEqual(len(history), 2)
示例#6
0
文件: test_history.py 项目: tony/rl
 def test_replace(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[2] = 'dino'
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[0] = 'hopper'
     self.assertEqual(history[0], 'hopper')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     history[-1] = 'bedrock'
     self.assertEqual(history[0], 'hopper')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'dino')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bedrock')
示例#7
0
 def test_read_tilde_expanded(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(self.histfile, raise_exc=True)
     history.clear()
     history.read_file('~/.history', raise_exc=True)
     self.assertEqual(len(history), 2)
示例#8
0
 def test_read_bytes_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(bytes('my_history', sys.getfilesystemencoding()), raise_exc=True)
     history.clear()
     history.read_file(bytes('my_history', sys.getfilesystemencoding()), raise_exc=True)
     self.assertEqual(len(history), 2)
示例#9
0
 def test_read_abspath(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.read_file(abspath('my_history'), raise_exc=True)
     self.assertEqual(len(history), 2)
示例#10
0
文件: test_history.py 项目: tony/rl
 def setUp(self):
     reset()
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     history.append('pebbles')
示例#11
0
 def test_read_abspath(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.read_file(abspath('my_history'), raise_exc=True)
     self.assertEqual(len(history), 2)
示例#12
0
 def test_read_None_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(self.histfile, raise_exc=True)
     history.clear()
     history.read_file(None, raise_exc=True)
     self.assertEqual(len(history), 2)
示例#13
0
 def test__reversed__items(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual([x for x in reversed(history)], ['bammbamm', 'pebbles', 'betty', 'barney', 'wilma'])
     history.append('dino')
     self.assertEqual([x for x in reversed(history)], ['dino', 'bammbamm', 'pebbles', 'betty', 'barney'])
     history[0] = 'hopper'
     self.assertEqual([x for x in reversed(history)], ['dino', 'bammbamm', 'pebbles', 'betty', 'hopper'])
示例#14
0
 def test__iter__items(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual([x for x in history], ['wilma', 'barney', 'betty', 'pebbles', 'bammbamm'])
     history.append('dino')
     self.assertEqual([x for x in history], ['barney', 'betty', 'pebbles', 'bammbamm', 'dino'])
     history[0] = 'hopper'
     self.assertEqual([x for x in history], ['hopper', 'betty', 'pebbles', 'bammbamm', 'dino'])
示例#15
0
 def test_append_relative(self):
     history.write_file('my_history', raise_exc=True)
     history.append('fred')
     history.append('wilma')
     history.append_file(2, 'my_history')
     history.clear()
     history.read_file('my_history', raise_exc=True)
     self.assertEqual(len(history), 2)
示例#16
0
 def test_read_bytes_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(bytes('my_history',
                              sys.getfilesystemencoding()),
                        raise_exc=True)
     history.clear()
     history.read_file(bytes('my_history', sys.getfilesystemencoding()),
                       raise_exc=True)
     self.assertEqual(len(history), 2)
示例#17
0
 def test_unstifled(self):
     history.max_entries = -1
     # Extend history beyond 5 entries
     history.append('bammbamm')
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'wilma')
     self.assertEqual(history[2], 'barney')
     self.assertEqual(history[3], 'betty')
     self.assertEqual(history[4], 'pebbles')
     self.assertEqual(history[5], 'bammbamm')
     self.assertEqual(len(history), 6)
示例#18
0
文件: test_history.py 项目: tony/rl
 def test__iter__items(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual([x for x in history],
                      ['wilma', 'barney', 'betty', 'pebbles', 'bammbamm'])
     history.append('dino')
     self.assertEqual([x for x in history],
                      ['barney', 'betty', 'pebbles', 'bammbamm', 'dino'])
     history[0] = 'hopper'
     self.assertEqual([x for x in history],
                      ['hopper', 'betty', 'pebbles', 'bammbamm', 'dino'])
示例#19
0
文件: test_history.py 项目: tony/rl
 def test_unstifled(self):
     history.max_entries = -1
     # Extend history beyond 5 entries
     history.append('bammbamm')
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'wilma')
     self.assertEqual(history[2], 'barney')
     self.assertEqual(history[3], 'betty')
     self.assertEqual(history[4], 'pebbles')
     self.assertEqual(history[5], 'bammbamm')
     self.assertEqual(len(history), 6)
示例#20
0
文件: test_history.py 项目: tony/rl
 def test__reversed__items(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual([x for x in reversed(history)],
                      ['bammbamm', 'pebbles', 'betty', 'barney', 'wilma'])
     history.append('dino')
     self.assertEqual([x for x in reversed(history)],
                      ['dino', 'bammbamm', 'pebbles', 'betty', 'barney'])
     history[0] = 'hopper'
     self.assertEqual([x for x in reversed(history)],
                      ['dino', 'bammbamm', 'pebbles', 'betty', 'hopper'])
示例#21
0
文件: test_history.py 项目: tony/rl
 def test_iterate(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual([x for x in reversed(history)],
                      ['betty', 'barney', 'wilma', 'fred'])
示例#22
0
文件: test_history.py 项目: tony/rl
 def test_stifle_truncates_existing(self):
     history.max_entries = -1
     # Extend history beyond 5 entries
     history.append('bammbamm')
     history.append('dino')
     self.assertEqual(len(history), 7)
     # Now stifle
     history.max_entries = 5
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(history[4], 'dino')
     self.assertEqual(len(history), 5)
示例#23
0
 def test_stifle_truncates_existing(self):
     history.max_entries = -1
     # Extend history beyond 5 entries
     history.append('bammbamm')
     history.append('dino')
     self.assertEqual(len(history), 7)
     # Now stifle
     history.max_entries = 5
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(history[4], 'dino')
     self.assertEqual(len(history), 5)
示例#24
0
 def test_write_file_replaces_file(self):
     history.append('fred')
     history.append('wilma')
     history.append('pebbles')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.append('barney')
     history.append('betty')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.read_file('my_history', raise_exc=True)
     self.assertEqual(len(history), 2)
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
示例#25
0
 def test__iter__items(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual([x for x in history], ['fred', 'wilma', 'barney', 'betty'])
示例#26
0
文件: test_history.py 项目: tony/rl
 def test_iterate(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual([x for x in history],
                      ['fred', 'wilma', 'barney', 'betty'])
示例#27
0
 def test__reversed__items(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual([x for x in reversed(history)], ['betty', 'barney', 'wilma', 'fred'])
示例#28
0
文件: test_history.py 项目: tony/rl
 def test_set_slice(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertRaises(TypeError, history.__setitem__, slice(2, -1),
                       ['dino'])
示例#29
0
文件: test_history.py 项目: tony/rl
 def test__iter__items(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual([x for x in history],
                      ['fred', 'wilma', 'barney', 'betty'])
示例#30
0
文件: test_history.py 项目: tony/rl
 def test_reversed_iterator(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertRaises(TypeError, reversed, reversed(history))
     list = ['a', 'b', 'c', 'd']
     self.assertRaises(TypeError, reversed, reversed(list))
示例#31
0
文件: test_history.py 项目: tony/rl
 def test_iterate_exhausted(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     i = reversed(history)
     self.assertEqual([x for x in i], ['betty', 'barney', 'wilma', 'fred'])
     self.assertRaises(StopIteration, i.next)
示例#32
0
文件: test_history.py 项目: tony/rl
 def test_out_of_range_pos(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertRaises(IndexError, history.__getitem__, 4)
     self.assertRaises(IndexError, history.__getitem__, -5)
示例#33
0
 def test_reversed_iterator(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertRaises(TypeError, reversed, reversed(history))
     list = ['a', 'b', 'c', 'd']
     self.assertRaises(TypeError, reversed, reversed(list))
示例#34
0
 def test_iterate_iterator(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual([x for x in iter(reversed(history))], ['betty', 'barney', 'wilma', 'fred'])
     list = ['a', 'b', 'c', 'd']
     self.assertEqual([x for x in iter(reversed(list))], ['d', 'c', 'b', 'a'])
示例#35
0
 def test_out_of_range_pos(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertRaises(IndexError, history.__getitem__, 4)
     self.assertRaises(IndexError, history.__getitem__, -5)
示例#36
0
 def test_iterate_exhausted(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     i = reversed(history)
     self.assertEqual([x for x in i], ['betty', 'barney', 'wilma', 'fred'])
     self.assertRaises(StopIteration, next, i)
示例#37
0
文件: test_history.py 项目: tony/rl
 def test_length_hint(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     i = reversed(history)
     self.assertEqual(i.__length_hint__(), len(history))
     for n, x in enumerate(i):
         self.assertEqual(i.__length_hint__(), len(history) - n - 1)
示例#38
0
 def test_length_hint(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     i = reversed(history)
     self.assertEqual(i.__length_hint__(), len(history))
     for n, x in enumerate(i):
         self.assertEqual(i.__length_hint__(), len(history)-n-1)
示例#39
0
文件: test_history.py 项目: tony/rl
 def test_iterate_iterator(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual([x for x in iter(iter(history))],
                      ['fred', 'wilma', 'barney', 'betty'])
     list = ['a', 'b', 'c', 'd']
     self.assertEqual([x for x in iter(iter(list))], ['a', 'b', 'c', 'd'])
示例#40
0
文件: test_history.py 项目: tony/rl
 def test_negative_pos(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual(history[-4], 'fred')
     self.assertEqual(history[-3], 'wilma')
     self.assertEqual(history[-2], 'barney')
     self.assertEqual(history[-1], 'betty')
示例#41
0
 def test__getitem__(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'wilma')
     self.assertEqual(history[2], 'barney')
     self.assertEqual(history[3], 'betty')
示例#42
0
 def test_negative_pos(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual(history[-4], 'fred')
     self.assertEqual(history[-3], 'wilma')
     self.assertEqual(history[-2], 'barney')
     self.assertEqual(history[-1], 'betty')
示例#43
0
文件: test_history.py 项目: tony/rl
 def test__getitem__(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'wilma')
     self.assertEqual(history[2], 'barney')
     self.assertEqual(history[3], 'betty')
示例#44
0
 def test_stifled(self):
     history.max_entries = 5
     # Extend history beyond 5 entries
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     self.assertEqual(len(history), 5)
     # Add one more
     history.append('dino')
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(history[4], 'dino')
     self.assertEqual(len(history), 5)
示例#45
0
文件: test_history.py 项目: tony/rl
 def test_stifled(self):
     history.max_entries = 5
     # Extend history beyond 5 entries
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     self.assertEqual(len(history), 5)
     # Add one more
     history.append('dino')
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(history[4], 'dino')
     self.assertEqual(len(history), 5)
示例#46
0
 def test_write_file_replaces_file(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.append('barney')
     history.append('betty')
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.read_file('my_history', raise_exc=True)
     self.assertEqual(len(history), 2)
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
示例#47
0
 def test__delitem__(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     del history[1]
     self.assertEqual(len(history), 3)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     del history[-2]
     self.assertEqual(len(history), 2)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'betty')
示例#48
0
文件: test_history.py 项目: tony/rl
 def test_remove(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     del history[2]
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(len(history), 4)
     del history[0]
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(history[2], 'bammbamm')
     self.assertEqual(len(history), 3)
     del history[-1]
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(len(history), 2)
示例#49
0
 def test_remove(self):
     history.max_entries = 5
     history.append('bammbamm')
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'betty')
     self.assertEqual(history[3], 'pebbles')
     self.assertEqual(history[4], 'bammbamm')
     del history[2]
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'barney')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(len(history), 4)
     del history[0]
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(history[2], 'bammbamm')
     self.assertEqual(len(history), 3)
     del history[-1]
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(len(history), 2)
示例#50
0
 def test__setitem__(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     self.assertEqual(len(history), 4)
     history[1] = 'pebbles'
     self.assertEqual(len(history), 4)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(history[2], 'barney')
     self.assertEqual(history[3], 'betty')
     history[-2] = 'bammbamm'
     self.assertEqual(len(history), 4)
     self.assertEqual(history[0], 'fred')
     self.assertEqual(history[1], 'pebbles')
     self.assertEqual(history[2], 'bammbamm')
     self.assertEqual(history[3], 'betty')
示例#51
0
 def test_write_file_truncates_file(self):
     history.append('fred')
     history.append('wilma')
     history.append('pebbles')
     history.max_file = 2
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.read_file('my_history', raise_exc=True)
     self.assertEqual(len(history), 2)
     self.assertEqual(history[0], 'wilma')
     self.assertEqual(history[1], 'pebbles')
示例#52
0
 def test_write_abspath(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(abspath('my_history'), raise_exc=True)
     self.assertTrue(isfile(abspath('my_history')))
     self.assertTrue(isfile('my_history'))
示例#53
0
 def test_write_abspath(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(abspath('my_history'), raise_exc=True)
     self.assertTrue(isfile(abspath('my_history')))
     self.assertTrue(isfile('my_history'))
示例#54
0
 def test_write_None_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(None, raise_exc=True)
     self.assertTrue(isfile(self.histfile))
示例#55
0
 def test_write_relative(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('my_history', raise_exc=True)
     self.assertTrue(isfile('my_history'))
示例#56
0
 def test_write_file_stifled(self):
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     history.append('pebbles')
     history.append('bammbamm')
     history.append('dino')
     self.assertEqual(len(history), 7)
     history.max_entries = 5
     history.write_file('my_history', raise_exc=True)
     history.clear()
     history.max_entries = -1
     history.read_file('my_history', raise_exc=True)
     self.assertEqual(history[0], 'barney')
     self.assertEqual(history[1], 'betty')
     self.assertEqual(history[2], 'pebbles')
     self.assertEqual(history[3], 'bammbamm')
     self.assertEqual(history[4], 'dino')
     self.assertEqual(len(history), 5)
示例#57
0
 def test_write_tilde_expanded(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('~/.history', raise_exc=True)
     self.assertTrue(isfile(self.histfile))
示例#58
0
 def test_write_None_name(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(None, raise_exc=True)
     self.assertTrue(isfile(self.histfile))
示例#59
0
 def test_read_empty_string(self):
     history.append('fred')
     history.append('wilma')
     history.write_file(self.histfile, raise_exc=True)
     history.clear()
     self.assertRaises(IOError, history.read_file, '', raise_exc=True)
示例#60
0
 def test_write_relative(self):
     history.append('fred')
     history.append('wilma')
     history.write_file('my_history', raise_exc=True)
     self.assertTrue(isfile('my_history'))