Skip to content

Commit

Permalink
Remove Anki module mocking where not required anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Stvad committed Jul 5, 2020
1 parent 8a35f6b commit 12f2873
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
5 changes: 1 addition & 4 deletions test/export/anki_exporter_wrapper_spec.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from mamba import describe, it, context
from unittest.mock import MagicMock

from test_utils.anki import mock_anki_modules

mock_anki_modules()
from mamba import describe, it, context

from crowd_anki.export.anki_exporter_wrapper import AnkiJsonExporterWrapper

Expand Down
16 changes: 7 additions & 9 deletions test/export/note_sorter_spec.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import logging

from mamba import describe, it, context
from unittest.mock import MagicMock
from random import shuffle
from unittest.mock import MagicMock

from test_utils.anki import mock_anki_modules

mock_anki_modules()
from aqt import mw
from mamba import describe, it, context

from crowd_anki.export.note_sorter import NoteSorter
from crowd_anki.config.config_settings import ConfigSettings, NoteSortingMethods
from crowd_anki.export.note_sorter import NoteSorter

test_guids = ["abc", "bcd", "cde", "def", "efg", "fgh"]
test_flags = [0, 1, 2, 3, 4, 5]
Expand Down Expand Up @@ -125,7 +121,8 @@ def sort_with(self, sort_methods, reverse_sort, is_multi_key=False):
with it("sorts by two sorting methods, notemodels+guids"):
self.tester = NoteSorterTester()

self.tester.sort_with([NoteSortingMethods.NOTE_MODEL_NAME, NoteSortingMethods.GUID], False, is_multi_key=True)
self.tester.sort_with([NoteSortingMethods.NOTE_MODEL_NAME, NoteSortingMethods.GUID], False,
is_multi_key=True)

return_object = [
(NoteSorter.sorting_definitions[NoteSortingMethods.NOTE_MODEL_NAME](note),
Expand All @@ -138,7 +135,8 @@ def sort_with(self, sort_methods, reverse_sort, is_multi_key=False):
with it("sorts by two sorting methods, notemodels+guids, reversed"):
self.tester = NoteSorterTester()

self.tester.sort_with([NoteSortingMethods.NOTE_MODEL_NAME, NoteSortingMethods.GUID], True, is_multi_key=True)
self.tester.sort_with([NoteSortingMethods.NOTE_MODEL_NAME, NoteSortingMethods.GUID], True,
is_multi_key=True)

return_object = [
(NoteSorter.sorting_definitions[NoteSortingMethods.NOTE_MODEL_NAME](note),
Expand Down

0 comments on commit 12f2873

Please sign in to comment.