1
0
favro-sync/test/test_client.py
Jon Michael Aanes d24bbff21d
All checks were successful
Test Python / Test (push) Successful in 26s
Ruff
2024-10-01 10:29:12 +02:00

40 lines
937 B
Python

import pytest
from favro_sync import secrets
from favro_sync.favro_client import FavroClient, OrganizationId, SeqId
needs_secrets = pytest.mark.skipif(
not secrets.has_secrets(),
reason='Secrets required',
)
@needs_secrets
def test_create_client():
client = create_client()
assert client is not None
client.check_logged_in()
@needs_secrets
def test_get_card():
client = create_client()
card = client.get_card(SeqId(11368))
print(card)
assert card is not None
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
def create_client():
return FavroClient(
favro_org_id=OrganizationId(secrets.favro_org_id()),
favro_username=secrets.favro_username(),
favro_password=secrets.favro_password(),
read_only=True,
)