Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Jan 8, 2025
1 parent 1dc9349 commit f920127
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion robotframework_reportportal/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def _build_msg_struct(self, message: Dict[str, Any]) -> LogMessage:
else:
msg = LogMessage(message["message"])
msg.level = message["level"]
msg.item_id = self.current_item.rp_item_id
current_item = self.current_item
if current_item:
msg.item_id = current_item.rp_item_id

message_str = msg.message
if is_binary(message_str):
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
limitations under the License.
"""

from unittest import mock

import pytest

from robotframework_reportportal.model import Keyword
Expand All @@ -28,6 +30,8 @@
)
def test_keyword_get_type(kwd_attributes, self_type, parent_type, expected):
"""Test for the get_type() method of the Keyword model."""
kwd = Keyword(name="Test keyword", robot_attributes=kwd_attributes, parent_type=parent_type)
parent = mock.Mock()
parent.type = parent_type
kwd = Keyword(name="Test keyword", robot_attributes=kwd_attributes, parent=parent)
kwd.keyword_type = self_type
assert kwd.get_type() == expected

0 comments on commit f920127

Please sign in to comment.