Beispiel #1
0
	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)
Beispiel #2
0
	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)
Beispiel #3
0
	def test_addRating(self):
		imageDatabase.wipeDatabase()
		imageDatabase.addImage("test")
		imageDatabase.addRating("test", "4")
		ratings = imageDatabase.returnImage("test")['ratings']
		self.assertEqual(ratings[0], "4")