def testAddFeed(self): model = self.feedModel feed = Mock("Feed") feed.title = "Title3" feed.author = "Author3" feed.updated = time.gmtime(time.time()) feed.unread = 2 feed.entries = [1, 4] self.assertEqual(model.rowCount(), 2) model.addFeed(feed) self.assertEqual(model.rowCount(), 3)
def setUp(self): self.feedMgr = FeedManager() feed = Mock("Feed") feed.title = "Title1" feed.author = "Author1" feed.url = "Url1" feed.updated = time.gmtime(time.time()) feed.unread = 1 feed.entries = [Entry(), Entry(), Entry()] self.feedMgr.feeds.append(feed) feed = Mock("Feed") feed.title = "Title2" feed.author = "Author2" feed.url = "Url2" feed.updated = time.gmtime(time.time()) feed.unread = 0 feed.entries = [Entry(), Entry()] self.feedMgr.feeds.append(feed) self.feedModel = FeedModel(self.feedMgr) self.modeltest = ModelTest(self.feedModel, self.feedModel) self.entryModel = MockEntryModel()