def test_complex(self): td = TagDict() td.add('tag') rl = RecordList() dt = datetime(year=2021, month=1, day=15, hour=21, minute=13) rl.append(Record(dt, note='test')) ws = WordSet() with self.assertRaises(Exception): ws.check_note('test') ws.check_note('test', update=True) self.assertEqual('0) tag', str(td)) self.assertEqual('[15.01.2021 21:13:00] <tag> test', str(rl)) ws.check_note('test') db.save() db.clear() self.assertEqual('', str(td)) self.assertEqual('', str(rl)) with self.assertRaises(Exception): ws.check_note('test') db.load() self.assertEqual('0) tag', str(td)) self.assertEqual('[15.01.2021 21:13:00] <tag> test', str(rl)) ws.check_note('test')
def test_simple(self): key = 'key' value = 'value' db[key] = value self.assertEqual(value, db[key]) db.save() db.clear() with self.assertRaises(KeyError): value = db[key] db.load() self.assertEqual(value, db[key])
def wrapper(*args, **kwargs): db.load() result = to_wrap(*args, **kwargs) db.save() return result
def setUp(self) -> None: db.load() self._gui_manager = GUIManager()
def setUp(self) -> None: db.load() self._tag_dict = TagDict() self._diary_manager = DiaryManager()
def test_no_file(self): os.remove('test.db') db.load()
def setUp(self) -> None: db.load()
def setUp(self) -> None: db.load() self._word_set = WordSet()
def setUp(self) -> None: db.load() self._tag_dict = TagDict()
def setUp(self) -> None: db.load() td = TagDict() td.add('no tag') td.add('test tag') self._record_list = RecordList()
def setUp(self) -> None: db.load() td = TagDict() td.add('no tag') td.add('test tag')