예제 #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'))