

def test_restricted_path_function_not_allowed(self):
    fake_function = self.mox.CreateMockAnything()
    stubs.FakeFile.is_file_accessible('foo').AndReturn(False)
    self.mox.ReplayAll()
    restricted_path_fake_function = stubs.RestrictedPathFunction(fake_function)
    with self.assertRaises(OSError) as cm:
        restricted_path_fake_function('foo', bar='baz')
    self.mox.VerifyAll()
    e = cm.exception
    self.assertEqual(errno.EACCES, e.errno)
    self.assertEqual('path not accessible', e.strerror)
    self.assertEqual('foo', e.filename)

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/python/stubs_test.py StubsTest.test_restricted_path_function_not_allowed/original