def test_getRating(self): imageDatabase.wipeDatabase() imageDatabase.addImage("test") imageDatabase.addRating("test", "5") imageDatabase.addRating("test", "3") rating = imageDatabase.getRating("test") self.assertEqual(rating, 4)
def test_getRatings(self): imageDatabase.wipeDatabase() imageDatabase.addImage("test") imageDatabase.addRating("test", "4") imageDatabase.addRating("test", "3") ratings = imageDatabase.getRatings("test") numRatings = len(ratings) self.assertEqual(numRatings, 2)
def test_addRating(self): imageDatabase.wipeDatabase() imageDatabase.addImage("test") imageDatabase.addRating("test", "4") ratings = imageDatabase.returnImage("test")['ratings'] self.assertEqual(ratings[0], "4")