def test__checkblk(self): ''' Confirm that we call cmd.run with ignore_retcode=True ''' cmd_mock = Mock() with patch.dict(blockdev.__salt__, {'cmd.run': cmd_mock}): blockdev._checkblk('/dev/foo') cmd_mock.assert_called_once_with( ['blkid', '-o', 'value', '-s', 'TYPE', '/dev/foo'], ignore_retcode=True)
def test__checkblk(): """ Confirm that we call cmd.run with ignore_retcode=True """ cmd_mock = Mock() with patch.dict(blockdev.__salt__, {"cmd.run": cmd_mock}): blockdev._checkblk("/dev/foo") cmd_mock.assert_called_once_with( ["blkid", "-o", "value", "-s", "TYPE", "/dev/foo"], ignore_retcode=True)