Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (34 sloc) 1.061 kb
7e07362 @tlevine tests file
authored
1 from unittest import TestCase,main
9f23e67 @tlevine tests
authored
2 import os
7e07362 @tlevine tests file
authored
3
9f23e67 @tlevine tests
authored
4 class TestDb(TestCase):
5 def setUp(self):
6 self.cleanUp()
7
8 def tearDown(self):
9 self.cleanUp()
10
11 def cleanUp(self):
12 "Clean up temporary files."
13 for filename in ('test.db', 'highwall.db'):
14 try:
15 os.remove(filename)
16 except OSError as e:
17 if (2, 'No such file or directory')!=e:
18 raise
19
d651122 @tlevine test
authored
20 class TestParams(TestDb):
21 def test_params(self):
22 self.assertFalse(os.path.isfile('test.db'))
23 h = Highwall(dbname='test.db',auto_commit=False,vars_table="baz")
24 self.assertTrue(os.path.isfile('test.db'))
25 self.assertEqual(h.auto_commit, False)
26 self.assertEqual(h.__vars_table, "baz")
9f23e67 @tlevine tests
authored
27
d651122 @tlevine test
authored
28 class TestParamsDefaults(TestDb):
29 def test_params(self):
37148b3 @tlevine test defaults
authored
30 self.assertFalse(os.path.isfile('highwall.db'))
31 h = Highwall()
32 self.assertTrue(os.path.isfile('highwall.db'))
33 self.assertEqual(h.auto_commit, True)
34 self.assertEqual(h.__vars_table, "_highwallvars")
35
9f23e67 @tlevine tests
authored
36 class TestSave(TestDb):
7e07362 @tlevine tests file
authored
37 def test_foo_bar(self):
38 pass
39
40 if __name__ == '__main__':
41 main()
Something went wrong with that request. Please try again.