Skip to content

Commit

Permalink
Dev: unittests: Adjust unit test for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxin1300 committed Jan 26, 2025
1 parent a3fdee8 commit 5c84927
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/unittests/test_cliformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_comment2():

def test_nvpair_ref1():
factory.create_from_cli("primitive dummy-0 Dummy params $fiz:buz=bin")
roundtrip('primitive dummy-1 Dummy params @fiz:boz')
roundtrip('primitive dummy-1 Dummy params @fiz')


def test_idresolve():
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_crashtest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_fence_action_none(self, mock_get_property, mock_error):
res = self.fence_info_inst.fence_action
self.assertEqual(res, None)
mock_get_property.assert_called_once_with("stonith-action")
mock_error.assert_called_once_with('Cluster property "stonith-action" should be reboot|off|poweroff')
mock_error.assert_called_once_with('Cluster property "stonith-action" should be off|reboot')

@mock.patch('crmsh.crash_test.utils.crmshutils.get_property')
def test_fence_action(self, mock_get_property):
Expand Down
3 changes: 1 addition & 2 deletions test/unittests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ def test_nvpair_ref(self):
self.assertEqual(out.get('class'), 'ocf')
self.assertEqual(['foo'], out.xpath('.//nvpair/@id-ref'))

out = self._parse('primitive dummy-0 Dummy params @fiz:buz')
out = self._parse('primitive dummy-0 Dummy params @fiz')
self.assertEqual(out.get('id'), 'dummy-0')
self.assertEqual(out.get('class'), 'ocf')
self.assertEqual(['fiz'], out.xpath('.//nvpair/@id-ref'))
self.assertEqual(['buz'], out.xpath('.//nvpair/@name'))

@mock.patch('logging.Logger.error')
def test_location(self, mock_error):
Expand Down

0 comments on commit 5c84927

Please sign in to comment.