File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -724,7 +724,7 @@ def _list_video_objects(
724
724
i.e.
725
725
objects: list[object], count: int, next_page_offset: Optional[int]
726
726
"""
727
- index = request_filter .offset + 1 or 1
727
+ index = 1 if request_filter is not None else request_filter .offset + 1
728
728
page_size = request_filter .page_size
729
729
objects = []
730
730
Original file line number Diff line number Diff line change @@ -132,6 +132,32 @@ def test_list_archives():
132
132
assert archives [1 ].url == 'https://example.com/archive.mp4'
133
133
assert archives [1 ].max_bitrate == 2_000_000
134
134
135
+ @responses .activate
136
+ def test_list_archives ():
137
+ build_response (
138
+ path ,
139
+ 'GET' ,
140
+ 'https://video.api.vonage.com/v2/project/test_application_id/archive' ,
141
+ 'list_archives.json' ,
142
+ )
143
+
144
+ filter = ListArchivesFilter (session_id = 'test_session_id' )
145
+ archives , count , next_page = video .list_archives (filter )
146
+
147
+ assert count == 2
148
+ assert next_page is None
149
+ assert archives [0 ].id == '5b1521e6-115f-4efd-bed9-e527b87f0699'
150
+ assert archives [0 ].status == 'paused'
151
+ assert archives [0 ].resolution == '1280x720'
152
+ assert archives [0 ].session_id == 'test_session_id'
153
+ assert archives [1 ].id == 'a9cdeb69-f6cf-408b-9197-6f99e6eac5aa'
154
+ assert archives [1 ].status == 'available'
155
+ assert archives [1 ].reason == 'session ended'
156
+ assert archives [1 ].duration == 134
157
+ assert archives [1 ].sha256_sum == 'test_sha256_sum'
158
+ assert archives [1 ].url == 'https://example.com/archive.mp4'
159
+ assert archives [1 ].max_bitrate == 2_000_000
160
+
135
161
136
162
@responses .activate
137
163
def test_start_archive ():
You can’t perform that action at this time.
0 commit comments