Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return download/messages endpoint back #107

Closed
Closed
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
3 changes: 2 additions & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,5 @@ BugFixes without ticket

## BugFixes
1. [TH2-5222] - Fix `DownloadMessagesByPageGzip`, it constructed `DownloadMessagesByPageByGroupsGzip` incorrectly.
2. [TH2-5243] - Fix backward compatibility issues with `GetMessagesByBookByGroups` and `GetMessagesByPageByGroups`.
2. [TH2-5243] - Fix backward compatibility issues with `GetMessagesByBookByGroups` and `GetMessagesByPageByGroups`,
added 'limit' and 'search_direction' parameters to 'post_download_messages'.
14 changes: 14 additions & 0 deletions tests/tests_unit/tests_common/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import pytest
from datetime import datetime

from th2_data_services.data_source.lwdp import Stream, Streams
from th2_data_services.data_source.lwdp.streams import _convert_stream_to_dict_format
from th2_data_services.data_source.lwdp.utils import _check_timestamp


def test_datetime_invalid_type():
with pytest.raises(Exception) as err:
_check_timestamp(datetime.now().timestamp())
assert "Provided timestamp should be `datetime`, `str` or `int` object in UTC time" in str(err)


def test_convert_stream_to_dict_format():
streams = ['s1:1', {'sessionAlias': 's2', 'direction': ['IN']}, Stream('s3', 2), Streams(['s4'])]
expected = [
{'sessionAlias': 's1', 'direction': ['IN']},
{'sessionAlias': 's2', 'direction': ['IN']},
{'sessionAlias': 's3', 'direction': ['OUT']},
{'sessionAlias': 's4'}
]
assert _convert_stream_to_dict_format(streams) == expected
Loading
Loading