From f74336ee0ef267706dfd170054a996be3fef3f31 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 27 2015 11:26:26 +0000 Subject: Add unit-tests for progit.lib.search_user when no args are specified --- diff --git a/tests/test_progitlib.py b/tests/test_progitlib.py index 46c18fe..7c62511 100644 --- a/tests/test_progitlib.py +++ b/tests/test_progitlib.py @@ -30,6 +30,21 @@ class ProgitLibtests(tests.Modeltests): tests.create_projects(self.session) self.assertEqual(1, progit.lib.get_next_id(self.session, 1)) + def test_search_user_all(self): + """ Test the search_user of progit.lib. """ + + # Retrieve all users + items = progit.lib.search_user(self.session) + self.assertEqual(2, len(items)) + self.assertEqual(1, items[0].id) + self.assertEqual('pingou', items[0].user) + self.assertEqual('pingou', items[0].username) + self.assertEqual([], items[0].groups) + self.assertEqual(2, items[1].id) + self.assertEqual('foo', items[1].user) + self.assertEqual('foo', items[1].username) + self.assertEqual([], items[1].groups) + if __name__ == '__main__': SUITE = unittest.TestLoader().loadTestsFromTestCase(ProgitLibtests)