# Path: crowd_anki/history/archiver.py
# class AllDeckArchiver(Archiver):
#     decks: DeckManager
#     deck_archiver_supplier: Callable[[AnkiDeck], Archiver]
# 
#     def archive(self, overrides: Iterable = tuple(), reason: str = None):
#         for deck in self.decks.leaf_decks(overrides):  # todo asyncio?
#             self.deck_archiver_supplier(deck).archive(reason=reason)


from mamba import description, it, before
from unittest.mock import MagicMock
from crowd_anki.history.archiver import AllDeckArchiver


with description(AllDeckArchiver) as self:
    with before.each:
        self.deck_without_children = MagicMock()

        self.deck_manager = MagicMock()
        self.deck_manager.leaf_decks.return_value = [self.deck_without_children]

        self.archiver_supplier = MagicMock()


# Path: crowd_anki/history/archiver.py
# class AllDeckArchiver(Archiver):
#     decks: DeckManager
#     deck_archiver_supplier: Callable[[AnkiDeck], Archiver]
# 
#     def archive(self, overrides: Iterable = tuple(), reason: str = None):
#         for deck in self.decks.leaf_decks(overrides):  # todo asyncio?
#             self.deck_archiver_supplier(deck).archive(reason=reason)


# Path: test/history/all_deck_archiver_spec.py
from mamba import description, it, before
from unittest.mock import MagicMock
from crowd_anki.history.archiver import AllDeckArchiver



with description(AllDeckArchiver) as self:
    with before.each:
        self.deck_without_children = MagicMock()

        self.deck_manager = MagicMock()
        self.deck_manager.leaf_decks.return_value = [self.deck_without_children]

        self.archiver_supplier = MagicMock()


        self.all_deck_archiver = AllDeckArchiver(self.deck_manager, self.archiver_supplier)