Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion video/src/vonage_video/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def _list_video_objects(
i.e.
objects: list[object], count: int, next_page_offset: Optional[int]
"""
index = request_filter.offset + 1 or 1
index = 1 if request_filter is not None else request_filter.offset + 1
page_size = request_filter.page_size
objects = []

Expand Down
26 changes: 26 additions & 0 deletions video/tests/test_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,32 @@ def test_list_archives():
assert archives[1].url == 'https://example.com/archive.mp4'
assert archives[1].max_bitrate == 2_000_000

@responses.activate
def test_list_archives_no_parameters():
build_response(
path,
'GET',
'https://video.api.vonage.com/v2/project/test_application_id/archive',
'list_archives.json',
)

filter = ListArchivesFilter(session_id='test_session_id')
archives, count, next_page = video.list_archives(filter)

assert count == 2
assert next_page is None
assert archives[0].id == '5b1521e6-115f-4efd-bed9-e527b87f0699'
assert archives[0].status == 'paused'
assert archives[0].resolution == '1280x720'
assert archives[0].session_id == 'test_session_id'
assert archives[1].id == 'a9cdeb69-f6cf-408b-9197-6f99e6eac5aa'
assert archives[1].status == 'available'
assert archives[1].reason == 'session ended'
assert archives[1].duration == 134
assert archives[1].sha256_sum == 'test_sha256_sum'
assert archives[1].url == 'https://example.com/archive.mp4'
assert archives[1].max_bitrate == 2_000_000


@responses.activate
def test_start_archive():
Expand Down