Exemple #1
0
 def test_init_redis_connection(self, mock_redis, mock_queryset):
     stream = BaseStream()
     self.assertIsNone(stream.redis)
     stream.init_redis_connection()
     mock_redis.assert_called_once_with()
     self.assertEqual(stream.redis, "redis")
     mock_redis.reset_mock()
     stream.init_redis_connection()
     self.assertFalse(mock_redis.called)
 def test_init(self, mock_queryset):
     stream = BaseStream(last_id=333, user="******")
     self.assertEqual(stream.last_id, 333)
     self.assertEqual(stream.user, "user")
 def setUp(self):
     super().setUp()
     self.stream = BaseStream(user=self.user)