SHOW:
|
|
- or go back to the newest paste.
1 | - | class MovieTest(unittest.TestCase): |
1 | + | class MovieTest(unittest.TestCase): |
2 | - | def test_summary(self): |
2 | + | def test_summary(self): |
3 | - | movie = Movie("X", "1990", "John Doe", Ratings()) |
3 | + | movie = Movie("X", "1990", "John Doe", Ratings()) |
4 | - | self.assertEqual("TITLE: X YEAR: 1990 DIRECTOR: John Doe AVG RATING: 0.00", movie.summarize()) |
4 | + | self.assertEqual("TITLE: X YEAR: 1990 DIRECTOR: John Doe AVG RATING: 0.00", movie.summarize()) |
5 | - | |
5 | + | |
6 | - | |
6 | + | |
7 | - | class RatingsTest(unittest.TestCase): |
7 | + | class RatingsTest(unittest.TestCase): |
8 | - | def test_ratings(self): |
8 | + | def test_ratings(self): |
9 | - | ratings = Ratings() |
9 | + | ratings = Ratings() |
10 | - | ratings.rate(4) |
10 | + | ratings.rate(4) |
11 | - | ratings.rate(2) |
11 | + | ratings.rate(2) |
12 | - | self.assertEqual(3, ratings.average_rating()) |
12 | + | self.assertEqual(3, ratings.average_rating()) |
13 | - | |
13 | + | |
14 | - | def test_empty_ratings(self): |
14 | + | def test_empty_ratings(self): |
15 | - | ratings = Ratings() |
15 | + | ratings = Ratings() |
16 | self.assertEqual(0, ratings.average_rating()) |