1
0

Ruff
All checks were successful
Test Python / Test (push) Successful in 26s

This commit is contained in:
Jon Michael Aanes 2024-10-01 10:29:12 +02:00
parent b3c2d9408e
commit d24bbff21d
5 changed files with 14 additions and 10 deletions

View File

@ -33,7 +33,8 @@ class FavroStat(fuse.Stat):
CARD_FILENAME_FORMAT = 'PAR-{seq_id}.md'
CARD_FILENAME_REGEX = r'^\/PAR\-(\d+)\.md$'
OFFICIAL_URL='https://favro.com/organization/{org_id}?card=par-{seq_id}'
OFFICIAL_URL = 'https://favro.com/organization/{org_id}?card=par-{seq_id}'
@dataclasses.dataclass(frozen=True)
class FileSystemItem:
@ -111,7 +112,6 @@ class FavroFuse(fuse.Fuse):
card = self.favro_client.get_card(thing.seq_id)
contents_str = self._format_card_file(card)
contents = bytes(contents_str, 'utf8')
@ -183,7 +183,7 @@ class FavroFuse(fuse.Fuse):
]
dependencies = [
CARD_FILENAME_FORMAT.format(
seq_id=self.favro_client.get_card_by_card_id(dep.card_id).seq_id.raw_id
seq_id=self.favro_client.get_card_by_card_id(dep.card_id).seq_id.raw_id,
)
for dep in card.dependencies
if dep.is_before
@ -194,7 +194,9 @@ class FavroFuse(fuse.Fuse):
tags,
assignments,
dependencies,
url=OFFICIAL_URL.format(org_id=card.organization_id.raw_id, seq_id=card.seq_id.raw_id),
url=OFFICIAL_URL.format(
org_id=card.organization_id.raw_id, seq_id=card.seq_id.raw_id,
),
)
return self.formatter.format_card_contents(card_contents)

View File

@ -2,6 +2,7 @@ import secret_loader
secrets = secret_loader.SecretLoader()
def has_secrets():
return secrets.load('FAVRO_ORGANIZATION_ID') is not None

View File

@ -29,6 +29,7 @@ def test_get_card():
assert len(card.attachments) == 0
assert len(card.custom_fields) == 2
def create_client():
return FavroClient(
favro_org_id=OrganizationId(secrets.favro_org_id()),

View File

@ -1,7 +1,6 @@
def test_import():
import favro_sync.favro_data_model # noqa
import favro_sync.favro_client # noqa
import favro_sync.favro_fuse # noqa
import favro_sync.favro_markdown # noqa
import favro_sync # noqa
import favro_sync.favro_data_model # noqa
import favro_sync.favro_client # noqa
import favro_sync.favro_fuse # noqa
import favro_sync.favro_markdown # noqa
import favro_sync # noqa

View File

@ -67,6 +67,7 @@ def test_parse_and_render_2():
assert '---' not in card_contents.description
assert FORMATTER.format_card_contents(card_contents) == EXAMPLE_TEXT_2
def test_parse_and_render_3():
card_contents = FORMATTER.parse_card_contents(EXAMPLE_TEXT_3)
print(card_contents)