Add get projects

This commit is contained in:
2024-02-24 17:42:26 +00:00
parent 4be5d4c325
commit 3d6fc32030
5 changed files with 92 additions and 14 deletions
@@ -13,10 +13,15 @@ class Test_Integration_Login(TestCase):
def test_login_success(self):
ac = ActiveCollab(config["base_url"])
session = ac.login_to_first_account(config["username"], config["password"])
pprint(session)
self.assertEqual(config["first_name"], session.user.first_name)
self.assertEqual(config["last_name"], session.user.last_name)
self.assertEqual(1, len(session.accounts))
self.assertGreater(len(session.token.token), 5)
def test_get_projects(self):
ac = ActiveCollab(config["base_url"])
ac.login_to_first_account(config["username"], config["password"])
projects = ac.get_projects()
self.assertGreater(len(projects), 0)
self.assertEqual('Project', projects[0].class_)
self.assertGreater(projects[0].id, 0)