test_iputil.py: use more realistic error for 'command not found' in mock.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
Daira Hopwood 2013-06-25 19:50:52 +01:00
parent b31a4f6e87
commit 16b245563d

View File

@ -99,8 +99,8 @@ class ListAddresses(testutil.SignalMixin, unittest.TestCase):
elif os.path.basename(args[0]) == command:
return FakeProcess(output, "")
else:
e = OSError("not found")
e.errno = errno.EEXIST
e = OSError("[Errno 2] No such file or directory")
e.errno = errno.ENOENT
raise e
self.patch(subprocess, 'Popen', call_Popen)