Esempio n. 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'))
Esempio n. 2
0
 def setUp(self):
     reset()
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     history.append('pebbles')
Esempio n. 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')
Esempio n. 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)
Esempio n. 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)
Esempio n. 6
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')
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 10
0
 def setUp(self):
     reset()
     history.append('fred')
     history.append('wilma')
     history.append('barney')
     history.append('betty')
     history.append('pebbles')
Esempio n. 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)
Esempio n. 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)
Esempio n. 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'])
Esempio n. 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'])
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 18
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'])
Esempio n. 19
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)
Esempio n. 20
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'])
Esempio n. 21
0
 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'])
Esempio n. 22
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)
Esempio n. 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)
Esempio n. 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')
Esempio n. 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'])
Esempio n. 26
0
 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'])
Esempio n. 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'])
Esempio n. 28
0
 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'])
Esempio n. 29
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'])
Esempio n. 30
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))
Esempio n. 31
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, i.next)
Esempio n. 32
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)
Esempio n. 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))
Esempio n. 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'])
Esempio n. 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)
Esempio n. 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)
Esempio n. 37
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)
Esempio n. 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)
Esempio n. 39
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(iter(history))],
                      ['fred', 'wilma', 'barney', 'betty'])
     list = ['a', 'b', 'c', 'd']
     self.assertEqual([x for x in iter(iter(list))], ['a', 'b', 'c', 'd'])
Esempio n. 40
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')
Esempio n. 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')
Esempio n. 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')
Esempio n. 43
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')
Esempio n. 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)
Esempio n. 45
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)
Esempio n. 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')
Esempio n. 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')
Esempio n. 48
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)
Esempio n. 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)
Esempio n. 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')
Esempio n. 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')
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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))
Esempio n. 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'))
Esempio n. 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)
Esempio n. 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))
Esempio n. 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))
Esempio n. 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)
Esempio n. 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'))