def testQueryNotificationsEmpty(self):
    """Try querying with no notifications."""
    self._validate = False

    # Delete all notifications for user #1.
    notifications = self._RunAsync(Notification.RangeQuery, self._client, self._user.user_id, None, None, None)
    for n in notifications:
      self._RunAsync(n.Delete, self._client)

    response_dict = self._tester.SendRequest('query_notifications', self._cookie, {})
    self.assertEqual(len(response_dict['notifications']), 0)

    # Scan in reverse order.
    response_dict = self._tester.SendRequest('query_notifications', self._cookie, {'scan_forward': False})
    self.assertEqual(len(response_dict['notifications']), 0)

    # Send a long-polling request.
    with self._AccelerateTime():
      real_start_time = time.time()
      ioloop_start_time = self.io_loop.time()
      # Don't use SendRequest so we can use a longer timeout on self.wait()
      self._tester.SendRequestAsync('query_notifications', self._cookie, {'max_long_poll': 60}, callback=self.stop)
      response_dict = self.wait(timeout=75)
      self.assertEqual(len(response_dict['notifications']), 0)
      real_end_time = time.time()
      ioloop_end_time = self.io_loop.time()
      # The request ran for up to max_long_poll in the artificial clock, but not in real time.
      # It should have finished just before max_long_poll expired, but the accelerated clock
      # makes it difficult to test precisely.
      self.assertGreater(ioloop_end_time - ioloop_start_time, 50)
      self.assertLess(real_start_time - real_end_time, 1)
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/test/query_notifications_test.py/QueryNotificationsTestCase.testQueryNotificationsEmpty/swapped operands of `-`