| Index: extensions/common/api/externs_checker_test.py
|
| diff --git a/extensions/common/api/externs_checker_test.py b/extensions/common/api/externs_checker_test.py
|
| index 73b65fa3c06266487bd14780d702d115f14962ed..9bcc651b679ab2d2495089f0ab50ef34b7fb6a06 100755
|
| --- a/extensions/common/api/externs_checker_test.py
|
| +++ b/extensions/common/api/externs_checker_test.py
|
| @@ -18,8 +18,9 @@ from PRESUBMIT_test_mocks import MockInputApi, MockOutputApi, MockFile
|
| class ExternsCheckerTest(unittest.TestCase):
|
| API_PAIRS = {'a': '1', 'b': '2', 'c': '3'}
|
|
|
| - def _runChecks(self, files):
|
| + def _runChecks(self, files, exists=lambda f: True):
|
| input_api = MockInputApi()
|
| + input_api.os_path.exists = exists
|
| input_api.files = [MockFile(f, '') for f in files]
|
| output_api = MockOutputApi()
|
| checker = ExternsChecker(input_api, output_api, self.API_PAIRS)
|
| @@ -58,6 +59,12 @@ class ExternsCheckerTest(unittest.TestCase):
|
| self.assertEquals(1, len(results[0].items))
|
| self.assertEquals('c', results[0].items[0])
|
|
|
| + def testApiFileDoesNotExist(self):
|
| + exists = lambda f: f in ['a', 'b', 'c', '1', '2']
|
| + with self.assertRaises(OSError) as e:
|
| + self._runChecks(['a'], exists)
|
| + self.assertEqual('Path Not Found: 3', str(e.exception))
|
| +
|
|
|
| if __name__ == '__main__':
|
| unittest.main()
|
|
|