Ruff
This commit is contained in:
parent
9fff7b972f
commit
4dd1b79f54
|
@ -34,6 +34,7 @@ URL_GET_TAG = URL_API_ROOT + '/tags/{tag_id}'
|
|||
URL_GET_CUSTOM_FIELD = URL_API_ROOT + '/customfields/{custom_field_id}'
|
||||
URL_GET_TASKS = URL_API_ROOT + '/tasks'
|
||||
|
||||
|
||||
class CardCache:
|
||||
def __init__(self):
|
||||
self.cards = []
|
||||
|
|
|
@ -48,10 +48,12 @@ class WidgetCommonId:
|
|||
class CustomFieldItemId:
|
||||
raw_id: str
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class TaskId:
|
||||
raw_id: str
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class TaskListId:
|
||||
raw_id: str
|
||||
|
@ -185,6 +187,7 @@ class CardDependency:
|
|||
CardId(json['reverseCardId']),
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Task:
|
||||
task_id: TaskId
|
||||
|
@ -207,6 +210,7 @@ class Task:
|
|||
position=json['position'],
|
||||
)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Card:
|
||||
card_id: CardId
|
||||
|
|
|
@ -61,8 +61,7 @@ class CardFileSystemItem(FileSystemItem):
|
|||
def to_card_contents(card: Card, favro_client: FavroClient) -> str:
|
||||
tags = [favro_client.get_tag(tag_id).name for tag_id in card.tags]
|
||||
assignments = [
|
||||
favro_client.get_user(assignment.user).name
|
||||
for assignment in card.assignments
|
||||
favro_client.get_user(assignment.user).name for assignment in card.assignments
|
||||
]
|
||||
dependencies = [
|
||||
CARD_FILENAME_FORMAT.format(
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import pytest
|
||||
|
||||
from favro_sync.favro_markdown import CardFileFormatter
|
||||
|
||||
EXAMPLE_TEXT_1 = """
|
||||
|
@ -60,6 +61,7 @@ EXAMPLES = [EXAMPLE_TEXT_1, EXAMPLE_TEXT_2, EXAMPLE_TEXT_3]
|
|||
|
||||
FORMATTER = CardFileFormatter()
|
||||
|
||||
|
||||
@pytest.mark.parametrize('example_text', EXAMPLES)
|
||||
def test_parse_and_render(example_text: str):
|
||||
card_contents = FORMATTER.parse_card_contents(example_text)
|
||||
|
|
Loading…
Reference in New Issue
Block a user