From fca96c935d2c50b040daa0a448369c4e6292945c Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Dec 2015 08:56:49 +0000 Subject: [PATCH] exception must be raise instead returning a response --- moto/kinesis/models.py | 2 +- moto/kinesis/responses.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/moto/kinesis/models.py b/moto/kinesis/models.py index d24afd2b7..a68103f26 100644 --- a/moto/kinesis/models.py +++ b/moto/kinesis/models.py @@ -203,7 +203,7 @@ class KinesisBackend(BaseBackend): def create_stream(self, stream_name, shard_count, region): if stream_name in self.streams: - return ResourceInUseError(stream_name) + raise ResourceInUseError(stream_name) stream = Stream(stream_name, shard_count, region) self.streams[stream_name] = stream return stream diff --git a/moto/kinesis/responses.py b/moto/kinesis/responses.py index 61a4a8199..dd364c49a 100644 --- a/moto/kinesis/responses.py +++ b/moto/kinesis/responses.py @@ -25,9 +25,7 @@ class KinesisResponse(BaseResponse): def create_stream(self): stream_name = self.parameters.get('StreamName') shard_count = self.parameters.get('ShardCount') - stream = self.kinesis_backend.create_stream(stream_name, shard_count, self.region) - if isinstance(stream, BadRequest): - return stream.description + self.kinesis_backend.create_stream(stream_name, shard_count, self.region) return "" def describe_stream(self):