Fix error for describing kinesis stream that has not been created.

This commit is contained in:
Steve Pulec 2015-11-02 13:25:31 -05:00
parent 99a4bcf98f
commit d9faab3e5e
2 changed files with 13 additions and 1 deletions

View File

@ -258,7 +258,10 @@ class KinesisBackend(BaseBackend):
return stream
def get_delivery_stream(self, stream_name):
return self.delivery_streams[stream_name]
if stream_name in self.delivery_streams:
return self.delivery_streams[stream_name]
else:
raise StreamNotFoundError(stream_name)
def list_delivery_streams(self):
return self.delivery_streams.values()

View File

@ -2,6 +2,7 @@ from __future__ import unicode_literals
import datetime
from botocore.exceptions import ClientError
import boto3
from freezegun import freeze_time
import sure # noqa
@ -86,6 +87,14 @@ def test_create_stream():
})
@mock_kinesis
@freeze_time("2015-03-01")
def test_deescribe_non_existant_stream():
client = boto3.client('firehose', region_name='us-east-1')
client.describe_delivery_stream.when.called_with(DeliveryStreamName='not-a-stream').should.throw(ClientError)
@mock_kinesis
@freeze_time("2015-03-01")
def test_list_and_delete_stream():