Beispiel #1
0
 def setUp(self):
     set_debug_log_level()
     self.dirs = {
         "nothing": tempfile.TemporaryDirectory(),
         "multiple": tempfile.TemporaryDirectory(),
         "perfect": tempfile.TemporaryDirectory(),
     }
     for d in self.dirs.values():
         iterative_gaussian_tree(
             d.name,
             repeat=5,
             nfolders=3,
             min_folders=1,
             nfiles=2,
             min_files=1,
             maxdepth=4,
         )
     self.dbs = {
         "nothing": [],
         "multiple":
         touch_file_in_random_folders(self.dirs["multiple"].name,
                                      "collection.anki2", 10),
         "perfect":
         touch_file_in_random_folders(self.dirs["perfect"].name,
                                      "collection.anki2", 1),
     }
     self.maxDiff = None
Beispiel #2
0
 def setUp(self):
     set_debug_log_level()
     self.db_read = load_db(self.db_read_path)
     self.db_write_dir = tempfile.TemporaryDirectory()
     self.db_write_path = (pathlib.Path(self.db_write_dir.name) /
                           "collection.anki2")
     self._reset()
Beispiel #3
0
 def setUp(self):
     set_debug_log_level()
     self.db_folder = (pathlib.Path(__file__).parent / "data" /
                       "few_basic_cards")
     self.version2db = {
         0: load_db(self.db_folder / "collection.anki2"),
         1: load_db(self.db_folder / "collection_v1.anki2"),
     }
Beispiel #4
0
    def setUp(self):
        set_debug_log_level()
        self.tmpdir = tempfile.TemporaryDirectory()
        self.tmpdir_path = Path(self.tmpdir.name)
        (self.tmpdir_path / "collection.anki2").touch()
        (self.tmpdir_path / "backups").mkdir()

        self.tmpdir_only_db = tempfile.TemporaryDirectory()
        self.tmpdir_only_db_path = Path(self.tmpdir_only_db.name)
        (self.tmpdir_only_db_path / "collection.anki2").touch()
Beispiel #5
0
 def setUp(self):
     set_debug_log_level()
     self.df = pd.DataFrame({
         "id_df": [1, 2, 3, 1, 1],
         "clash": ["a", "b", "c", "a", "a"]
     })
     self.df_add = pd.DataFrame({
         "id_add": [1, 2, 3],
         "value": [4, 5, 6],
         "drop": [7, 8, 9],
         "ignore": [10, 11, 12],
         "clash": [1, 1, 1],
     })
Beispiel #6
0
    def setUp(self):
        set_debug_log_level()
        self.db = raw.load_db(self.db_path)

        self.col = Collection(self.db_path)

        # Do not modify this one!
        self.notes = self.col.notes
        self.cards = self.col.cards
        self.revs = self.col.revs
        self.table2adf = {
            "notes": self.notes,
            "cards": self.cards,
            "revs": self.revs,
        }
        self.adfs = [self.notes, self.cards, self.revs]

        self.empty_notes = self.col.empty_notes()
        self.empty_cards = self.col.empty_cards()
        self.empty_revs = self.col.empty_revs()
Beispiel #7
0
 def setUp(self):
     set_debug_log_level()
Beispiel #8
0
from ankipandas.util.log import set_debug_log_level

set_debug_log_level()