Skip to content

Commit 111ca38

Browse files
authored
Merge pull request #6258 from harvey0100/processfix
Process CI Selftests Failure
2 parents fb9f609 + 40249d0 commit 111ca38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

selftests/unit/utils/process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,14 @@ def test_can_sudo_with_specific_cmd(self, getuid_mock, find_cmd_mock, system_moc
567567
system_mock.return_value = 0
568568
self.assertTrue(process.can_sudo("ls -l"))
569569

570-
@unittest.mock.patch("avocado.utils.process.system")
570+
@unittest.mock.patch("avocado.utils.process.getoutput")
571571
@unittest.mock.patch("avocado.utils.path.find_command")
572572
@unittest.mock.patch("avocado.utils.process.os.getuid")
573-
def test_can_sudo_oserror(self, getuid_mock, find_cmd_mock, system_mock):
573+
def test_can_sudo_oserror(self, getuid_mock, find_cmd_mock, getoutput_mock):
574574
"""Test can_sudo when OSError occurs"""
575575
getuid_mock.return_value = 1000
576576
find_cmd_mock.return_value = "/usr/bin/sudo"
577-
system_mock.side_effect = OSError()
577+
getoutput_mock.side_effect = OSError()
578578
self.assertFalse(process.can_sudo())
579579

580580
@unittest.mock.patch("avocado.utils.process.get_capabilities")

0 commit comments

Comments
 (0)