-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest.py
executable file
·43 lines (27 loc) · 962 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
import unittest
from lib import qif
import datetime
class TestQIF(unittest.TestCase):
def setUp(self):
pass
def test_get_qif_name(self):
name = qif.get_qif_name(
datetime.datetime(2010, 1, 1, 00, 00, 00),
datetime.datetime(2012, 4, 13, 00, 00, 00)
)
self.assertEqual(name, '2010.01.01 - 2012.04.13.qif')
def test_is_file_present(self):
found = qif.is_file_present('lib/db.py')
self.assertTrue(found)
found = qif.is_file_present('test.py')
self.assertTrue(found)
found = qif.is_file_present('./test.py')
self.assertTrue(found)
not_found = qif.is_file_present('aaa/bbb/ccc/test.py')
self.assertFalse(not_found)
def test_get_available_name(self):
name = qif.get_available_name('lib/db.py')
self.assertEqual(name, 'lib/db.py.1')
if __name__ == '__main__':
unittest.main()