Advertisement
libdo

Untitled

Oct 12th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MovieTest(unittest.TestCase):
  2. def test_summary(self):
  3. movie = Movie("X", "1990", "John Doe", Ratings())
  4. self.assertEqual("TITLE: X YEAR: 1990 DIRECTOR: John Doe AVG RATING: 0.00", movie.summarize())
  5.  
  6.  
  7. class RatingsTest(unittest.TestCase):
  8. def test_ratings(self):
  9. ratings = Ratings()
  10. ratings.rate(4)
  11. ratings.rate(2)
  12. self.assertEqual(3, ratings.average_rating())
  13.  
  14. def test_empty_ratings(self):
  15. ratings = Ratings()
  16. self.assertEqual(0, ratings.average_rating())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement