From a8decdc127d6677cb617d96d2b3ef868c9207af9 Mon Sep 17 00:00:00 2001 From: Frank Sauerburger <frank@sauerburger.com> Date: Sat, 27 Aug 2022 10:15:58 +0200 Subject: [PATCH] Test min_rating settings --- movies_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/movies_test.py b/movies_test.py index 07d0280..8211f15 100644 --- a/movies_test.py +++ b/movies_test.py @@ -29,3 +29,11 @@ class LoadTests(unittest.TestCase): self.assertEqual(user_movies[1], [1, 4]) self.assertEqual(user_movies[2], [3, 1]) self.assertEqual(set(user_movies.keys()), {1, 2}) + + def test_collect_user_context_min_rating(self): + """Check the min rating threshold""" + rating = self.toy_ratings() + user_movies = movies.collect_user_context(rating, min_rating=5) + + self.assertEqual(user_movies[1], [4]) + self.assertEqual(set(user_movies.keys()), {1}) -- GitLab