from unittest.mock import call


def callWithRaise(command):
  """
     Executes the command like call() does but then raise OSError it it fails.
  """
  status = call(command)
  if status:
     raise OSError("Failure on cmd: "+command)
  return status