def test_deleteFavGrp(self): dataobject = DataObject() dataobject.addFavGroup("xxx") self.assertEqual(len(dataobject.favs.favsList), 1) dataobject.deleteFavGroup("xxx") self.assertEqual(len(dataobject.favs.favsList), 0)
def test_addFavGroup(self): dataobject = DataObject() self.assertEqual(dataobject.undoStack.count(), 0) dataobject.addFavGroup("xxx") self.assertEqual(dataobject.undoStack.count(), 1) dataobject.addFavGroup("xxx") self.assertEqual(dataobject.undoStack.count(), 1)
def test_addFav_duplicates(self): dataobject = DataObject() dataobject.addFavGroup("xxx") self.assertEqual(len(dataobject.favs.favsList), 1) dataobject.addFav("xxx", "aaa") self.assertEqual(dataobject.undoStack.count(), 2) dataobject.addFav("xxx", "aaa") self.assertEqual(dataobject.undoStack.count(), 2)
def test_renameFavGrp(self): dataobject = DataObject() dataobject.addFavGroup("xxx") self.assertEqual(len(dataobject.favs.favsList), 1) dataobject.renameFavGroup("xxx", "yyy") self.assertEqual(len(dataobject.favs.favsList), 1) xxxFavs = dataobject.favs.getFavs("xxx") self.assertEqual(xxxFavs, None) yyyFavs = dataobject.favs.getFavs("yyy") self.assertNotEqual(yyyFavs, None)