Ejemplo n.º 1
0
 def test_image_download(self):
     handler = notifications.ImageDownload()
     counters = handler.process_notification(NOTIFICATION_SEND)
     self.assertEqual(len(counters), 1)
     download = counters[0]
     self._verify_common_counter(download, 'image.download', 42)
     self.assertEqual(download.user_id, fake_uuid('d'))
     self.assertEqual(download.project_id, fake_uuid('b'))
     self.assertEqual(download.type, counter.TYPE_DELTA)
Ejemplo n.º 2
0
 def test_image_download(self):
     handler = notifications.ImageDownload(mock.Mock())
     counters = list(handler.process_notification(NOTIFICATION_SEND))
     self.assertEqual(1, len(counters))
     download = counters[0]
     self._verify_common_counter(download, 'image.download', 42)
     self.assertEqual(fake_uuid('d'), download.user_id)
     self.assertEqual(fake_uuid('b'), download.project_id)
     self.assertEqual(sample.TYPE_DELTA, download.type)