'When C{FilePath.makedirs} is called with C{ignoreExistingDirectory} set
to C{True} it raises an C{OSError} exception if exception errno is not
EEXIST.'

def test_makedirsRaisesNonEexistErrorsIgnoreExistingDirectory(self):

    def faultyMakedirs(path):
        raise OSError(errno.EACCES, 'Permission    Denied')
    self.patch(os, 'makedirs', faultyMakedirs)
    fp = filepath.FilePath(self.mktemp())
    exception = self.assertRaises(OSError, fp.makedirs, ignoreExistingDirectory=True)
    self.assertEqual(exception.errno, errno.EACCES)
