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