Reorg code and tests

DON'T use main.py
This commit is contained in:
2024-02-24 12:02:12 +00:00
parent 662b75e224
commit 4be5d4c325
18 changed files with 271 additions and 85 deletions
+2
View File
@@ -0,0 +1,2 @@
@@ -0,0 +1,22 @@
import json
from pprint import pprint
from unittest import TestCase
from ActiveCollabAPI.ActiveCollab import ActiveCollab
with open("test-config.json", "r") as cfg:
config = json.load(cfg)
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)