Chromium Code Reviews| Index: tests/presubmit_unittest.py |
| =================================================================== |
| --- tests/presubmit_unittest.py (revision 82763) |
| +++ tests/presubmit_unittest.py (working copy) |
| @@ -1219,8 +1219,14 @@ |
| self.failUnless(af.LocalPath() == presubmit.normpath('foo/blat.cc')) |
| self.failUnless(af.Action() == 'M') |
| self.assertEquals(af.NewContents(), ['whatever', 'cookie']) |
| + |
| + def testAffectedFileNotExists(self): |
| + presubmit.os.path.exists('notfound.cc').AndReturn(False) |
| + presubmit.gclient_utils.FileRead('notfound.cc', 'rU').AndRaise(IOError) |
| + self.mox.ReplayAll() |
| af = presubmit.AffectedFile('notfound.cc', 'A') |
| self.failUnless(af.ServerPath() == '') |
| + self.failUnless(af.NewContents() == []) |
|
M-A Ruel
2011/04/27 14:07:43
nit: I prefer:
self.assertEquals('', af.ServerPath
ncarter (slow)
2011/04/27 20:55:13
Done.
|
| def testProperty(self): |
| presubmit.scm.SVN.GetFileProperty('foo.cc', 'svn:secret-property' |