Mercurial > hgsubversion
comparison tests/test_push_command.py @ 531:cf4fe45bf8fd
Change all instantiations of IOError to set both errno and strerror.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Tue, 26 Jan 2010 17:36:13 +0100 |
parents | c2d0e738c899 |
children | 8522f8ef799e |
comparison
equal
deleted
inserted
replaced
530:76e9504db03b | 531:cf4fe45bf8fd |
---|---|
1 import atexit | 1 import atexit |
2 import errno | |
2 import os | 3 import os |
3 import random | 4 import random |
4 import shutil | 5 import shutil |
5 import socket | 6 import socket |
6 import subprocess | 7 import subprocess |
104 return context.memfilectx(path=path, | 105 return context.memfilectx(path=path, |
105 data='foo', | 106 data='foo', |
106 islink=False, | 107 islink=False, |
107 isexec=False, | 108 isexec=False, |
108 copied=False) | 109 copied=False) |
109 raise IOError() | 110 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
110 ctx = context.memctx(repo, | 111 ctx = context.memctx(repo, |
111 parents=(repo['default'].node(), node.nullid), | 112 parents=(repo['default'].node(), node.nullid), |
112 text='automated test', | 113 text='automated test', |
113 files=['adding_file'], | 114 files=['adding_file'], |
114 filectxfn=file_callback, | 115 filectxfn=file_callback, |
143 return context.memfilectx(path=path, | 144 return context.memfilectx(path=path, |
144 data='foo', | 145 data='foo', |
145 islink=False, | 146 islink=False, |
146 isexec=False, | 147 isexec=False, |
147 copied=False) | 148 copied=False) |
148 raise IOError() | 149 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
149 ctx = context.memctx(repo, | 150 ctx = context.memctx(repo, |
150 (repo['default'].node(), node.nullid), | 151 (repo['default'].node(), node.nullid), |
151 'automated test', | 152 'automated test', |
152 ['adding_file'], | 153 ['adding_file'], |
153 file_callback, | 154 file_callback, |
211 return context.memfilectx(path=path, | 212 return context.memfilectx(path=path, |
212 data='foo2', | 213 data='foo2', |
213 islink=False, | 214 islink=False, |
214 isexec=False, | 215 isexec=False, |
215 copied=False) | 216 copied=False) |
216 raise IOError() | 217 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
217 ctx = context.memctx(repo, | 218 ctx = context.memctx(repo, |
218 (repo['default'].node(), node.nullid), | 219 (repo['default'].node(), node.nullid), |
219 'automated test', | 220 'automated test', |
220 ['adding_file2'], | 221 ['adding_file2'], |
221 file_callback, | 222 file_callback, |
246 return context.memfilectx(path=path, | 247 return context.memfilectx(path=path, |
247 data='foo', | 248 data='foo', |
248 islink=False, | 249 islink=False, |
249 isexec=False, | 250 isexec=False, |
250 copied=False) | 251 copied=False) |
251 raise IOError() | 252 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
252 ctx = context.memctx(repo, | 253 ctx = context.memctx(repo, |
253 (repo['the_branch'].node(), node.nullid), | 254 (repo['the_branch'].node(), node.nullid), |
254 'automated test', | 255 'automated test', |
255 ['adding_file'], | 256 ['adding_file'], |
256 file_callback, | 257 file_callback, |
299 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.') | 300 self.assertNotEqual(oldnode, self.repo['tip'].hex(), 'Revision was not pushed.') |
300 | 301 |
301 def test_delete_file(self): | 302 def test_delete_file(self): |
302 repo = self.repo | 303 repo = self.repo |
303 def file_callback(repo, memctx, path): | 304 def file_callback(repo, memctx, path): |
304 raise IOError() | 305 raise IOError(errno.EBADF, 'Operation on deleted file attempted') |
305 old_files = set(repo['default'].manifest().keys()) | 306 old_files = set(repo['default'].manifest().keys()) |
306 ctx = context.memctx(repo, | 307 ctx = context.memctx(repo, |
307 (repo['default'].node(), node.nullid), | 308 (repo['default'].node(), node.nullid), |
308 'automated test', | 309 'automated test', |
309 ['alpha'], | 310 ['alpha'], |
327 return context.memfilectx(path=path, | 328 return context.memfilectx(path=path, |
328 data='foo', | 329 data='foo', |
329 islink=False, | 330 islink=False, |
330 isexec=True, | 331 isexec=True, |
331 copied=False) | 332 copied=False) |
332 raise IOError() | 333 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
333 ctx = context.memctx(repo, | 334 ctx = context.memctx(repo, |
334 (repo['tip'].node(), node.nullid), | 335 (repo['tip'].node(), node.nullid), |
335 'message', | 336 'message', |
336 ['gamma', ], | 337 ['gamma', ], |
337 file_callback, | 338 file_callback, |
357 return context.memfilectx(path=path, | 358 return context.memfilectx(path=path, |
358 data='foo', | 359 data='foo', |
359 islink=True, | 360 islink=True, |
360 isexec=False, | 361 isexec=False, |
361 copied=False) | 362 copied=False) |
362 raise IOError() | 363 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
363 ctx = context.memctx(repo, | 364 ctx = context.memctx(repo, |
364 (repo['tip'].node(), node.nullid), | 365 (repo['tip'].node(), node.nullid), |
365 'message', | 366 'message', |
366 ['gamma', ], | 367 ['gamma', ], |
367 file_callback, | 368 file_callback, |