-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.py
34 lines (27 loc) · 830 Bytes
/
tests.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
#!/usr/bin/env python
# encoding: utf-8
"""
tests.py
Unit test cases for addressbook
"""
import unittest
import addressbook
class tests(unittest.TestCase):
def testAll(self):
""" Test retrieving all records """
self.assert_(addressbook.all())
def testGroups(self):
""" Test retrieving groups """
self.assert_(addressbook.groups())
def testMe(self):
""" Test retrieving current user """
self.assert_(addressbook.me())
def testGetByUID(self):
""" Test getByUID """
allr = addressbook.all()
for a in allr:
self.assert_(addressbook.getByUID(a['uid']))
break
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(tests)
unittest.TextTestRunner(verbosity=2).run(suite)