Beispiel #1
0
 def test_overload_err(self):
     try:
         raise ProvisionedThroughputExceededException("error", None, None)
     except ProvisionedThroughputExceededException:
         fail = Failure()
     self.base._overload_err(fail)
     self.status_mock.assert_called_with(503, reason=None)
Beispiel #2
0
 def test_delete_db_error(self):
     tok = ":".join(["m", dummy_uaid.hex, str(dummy_chid)])
     self.fernet_mock.decrypt.return_value = tok
     self.message_mock.configure_mock(**{
         "delete_message.side_effect":
         ProvisionedThroughputExceededException(None, None)})
     resp = yield self.client.delete(self.url(message_id="ignored"))
     eq_(resp.get_status(), 503)
Beispiel #3
0
    def test_delete_db_error(self):
        self.fernet_mock.decrypt.return_value = "m:123:456"
        self.message_mock.configure_mock(**{
            "delete_message.side_effect":
            ProvisionedThroughputExceededException(None, None)})

        def handle_finish(result):
            self.assertTrue(result)
            self.status_mock.assert_called_with(503)
        self.finish_deferred.addCallback(handle_finish)

        self.message.delete('')
        return self.finish_deferred
Beispiel #4
0
    def test_delete_db_error(self):
        tok = ":".join(["m", dummy_uaid.hex, str(dummy_chid)])
        self.fernet_mock.decrypt.return_value = tok
        self.message_mock.configure_mock(**{
            "delete_message.side_effect":
            ProvisionedThroughputExceededException(None, None)})

        def handle_finish(result):
            ok_(result)
            self.status_mock.assert_called_with(503, reason=None)
        self.finish_deferred.addCallback(handle_finish)

        self.message.delete(self._make_req("ignored"))
        return self.finish_deferred
Beispiel #5
0
 def _throw_provisioned_error(self, *args):
     raise ProvisionedThroughputExceededException(None, None)
Beispiel #6
0
 def _raise_db_error(self):
     raise ProvisionedThroughputExceededException(None, None)