def test_makedirsIgnoreExistingDirectoryExistAlreadyAFile(self):
        """
        When C{FilePath.makedirs} is called with C{ignoreExistingDirectory} set
        to C{True} it throws an C{OSError} exceptions if path is a file.
        """
        fp = filepath.FilePath(self.mktemp())
        fp.create()
        self.assertTrue(fp.isfile())

        exception = self.assertRaises(
            OSError, fp.makedirs, ignoreExistingDirectory=True)

        self.assertEqual(exception.errno, errno.EEXIST)

        When C{FilePath.makedirs} is called with C{ignoreExistingDirectory} set
        to C{True} it throws an C{OSError} exceptions if path is a file.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_paths.py