Пример #1
0
 def test_unpopular(self):
     """Test that a user with <=100 upvotes is not popular."""
     new_user = SocialMediaUser('Bryce', 'US')
     self.assertFalse(new_user.is_popular())
     for _ in range(randint(1, 100)):
         new_user.receive_upvote()
     self.assertFalse(new_user.is_popular())
Пример #2
0
 def test_popular(self):
     """Test that a user with >100 upvotes is popular."""
     user1 = SocialMediaUser('Jane')
     for _ in range(randint(101, 10000)):
         user1.receive_upvote()
     self.assertEqual(user1.is_popular(), True)
Пример #3
0
 def test_unpopular(self):
     """Test that a user with <=100 upvotes is not popular."""
     user1 = SocialMediaUser('Joe')
     for _ in range(randint(1, 100)):
         user1.receive_upvote()
     self.assertEqual(user1.is_popular(), False)
Пример #4
0
 def test_popular(self):
     """Test that a user with >100 upvotes is popular."""
     new_user = SocialMediaUser('Jack', 'US')
     for _ in range(randint(101, 10000)):
         new_user.receive_upvote()
     self.assertTrue(new_user.is_popular())