Skip to content

Commit

Permalink
fix rpmsg unit tests (Bugfix) (#1697)
Browse files Browse the repository at this point in the history
fix rpmsg unit tests
  • Loading branch information
stanley31huang authored Jan 23, 2025
1 parent 3e15472 commit e5b7c6f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ def test_get_rpmsg_state(self, mock_read):
self.assertEqual(self._rpmsg_load_fw_test.rpmsg_state, expected_result)

@patch("pathlib.Path.write_text")
def test_set_rpmsg_state(self, mock_write):
expected_result = "test-response"
def test_set_rpmsg_state_success(self, mock_write):
expected_result = "start"
self._rpmsg_load_fw_test.rpmsg_state = expected_result
mock_write.assert_called_once_with(expected_result)

def test_set_rpmsg_state_invalid_value(self):
with self.assertRaisesRegex(
ValueError, "Unsupported value for remote processor state"
):
self._rpmsg_load_fw_test.rpmsg_state = "invalid value"

def test_get_search_pattern(self):
self.assertDictEqual(
self._rpmsg_load_fw_test.search_pattern,
Expand Down

0 comments on commit e5b7c6f

Please sign in to comment.