Fix error for describing kinesis stream that has not been created.
This commit is contained in:
parent
99a4bcf98f
commit
d9faab3e5e
@ -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()
|
||||
|
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user