Skip to content

Commit

Permalink
Add test_get_streams_filtered_by_date
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Bastida committed May 27, 2015
1 parent 9f11220 commit 8b8c669
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ def test_get_streams(self):
self.assertEqual(self.aws.connection.describe_log_streams.call_args_list,
expected)

def test_get_streams_filtered_by_date(self):
self.aws.connection.describe_log_streams.side_effect = [
{'logStreams': [self._stream('A', 0, 1),
self._stream('B', 0, 6),
self._stream('C'),
self._stream('D', sys.maxint - 1, sys.maxint)],
}
]

self.aws.start, self.aws.end = 5, 7
expected = ['B', 'C']

self.assertEqual([g for g in self.aws.get_streams('group')], expected)

expected = [call(log_group_name="group", next_token=None)]

self.assertEqual(self.aws.connection.describe_log_streams.call_args_list,
expected)

def test_get_streams_from_pattern(self):
side_effect = [
{'logStreams': [self._stream('AAA'),
Expand Down

0 comments on commit 8b8c669

Please sign in to comment.