Пример #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)
Пример #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)
Пример #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")