2024-09-28 10:37:19 +00:00
|
|
|
from favro_sync import secrets
|
2024-09-28 12:10:13 +00:00
|
|
|
from favro_sync.favro_client import FavroClient, OrganizationId, SeqId
|
2024-09-28 10:37:19 +00:00
|
|
|
|
|
|
|
# TODO: Skip if no secrets
|
|
|
|
|
2024-09-28 10:54:34 +00:00
|
|
|
|
2024-09-28 10:37:19 +00:00
|
|
|
def test_create_client():
|
|
|
|
client = FavroClient(
|
|
|
|
favro_org_id=OrganizationId(secrets.favro_org_id()),
|
|
|
|
favro_username=secrets.favro_username(),
|
|
|
|
favro_password=secrets.favro_password(),
|
|
|
|
read_only=True,
|
|
|
|
)
|
|
|
|
assert client is not None
|
|
|
|
client.check_logged_in()
|
|
|
|
return client
|
|
|
|
|
2024-09-28 10:54:34 +00:00
|
|
|
|
2024-09-28 10:37:19 +00:00
|
|
|
def test_get_card():
|
|
|
|
client = test_create_client()
|
2024-09-28 12:10:13 +00:00
|
|
|
card = client.get_card(SeqId(11368))
|
|
|
|
print(card)
|
|
|
|
|
2024-09-28 10:37:19 +00:00
|
|
|
assert card is not None
|
2024-09-28 12:10:13 +00:00
|
|
|
assert card.name is not None
|
|
|
|
assert card.detailed_description is not None
|
|
|
|
assert len(card.dependencies) == 1
|
|
|
|
assert len(card.attachments) == 0
|
|
|
|
assert len(card.custom_fields) == 2
|