Skip to content

Commit

Permalink
refactor: remove tmp_dirs from pushprompts and promptdiffdeterminer
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Dec 13, 2023
1 parent caa1a43 commit 8e80469
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from pathlib import Path

from ..prompt_destination.destination_commands import (
DeletePrompts,
PushPrompts,
Expand All @@ -18,10 +16,8 @@ def test_diff_determiner():
assert syncer.only_in_destination() == ["3"]


def test_prompt_diff_determiner(tmp_path: Path):
syncer = PromptDiffDeterminer(
tmp_read_dir=tmp_path, tmp_write_dir=tmp_path
)
def test_prompt_diff_determiner():
syncer = PromptDiffDeterminer()

source_prompts = [
QAPrompt(question="a", answer="a"),
Expand Down Expand Up @@ -49,9 +45,5 @@ def test_prompt_diff_determiner(tmp_path: Path):
)
]
),
PushPrompts(
[QAPrompt(question="a", answer="a")],
tmp_write_dir=tmp_path,
tmp_read_dir=tmp_path,
),
PushPrompts([QAPrompt(question="a", answer="a")]),
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections.abc import Mapping
from pathlib import Path

import pytest

Expand Down Expand Up @@ -49,7 +48,7 @@ def test_ankiconnect_get_all_prompts(fields: Mapping[str, AnkiField]):
assert len(prompts) == 1


def test_ankiconnect_push_prompts(tmpdir: Path):
def test_ankiconnect_push_prompts():
gateway = SpieAnkiconnectGateway()
dest = AnkiConnectDestination(
gateway=gateway,
Expand Down
4 changes: 1 addition & 3 deletions personal_mnemonic_medium/v2/presentation/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def _sync_deck(
)
destination_prompts = destination.get_all_prompts()

update_commands = PromptDiffDeterminer(
tmp_write_dir=Path("/tmp"), tmp_read_dir=Path("/tmp")
).sync(
update_commands = PromptDiffDeterminer().sync(
source_prompts=source_prompts,
destination_prompts=destination_prompts,
)
Expand Down

0 comments on commit 8e80469

Please sign in to comment.