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)
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)
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
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
def _throw_provisioned_error(self, *args): raise ProvisionedThroughputExceededException(None, None)
def _raise_db_error(self): raise ProvisionedThroughputExceededException(None, None)