def METHOD_NAME(self) -> None:
    test = TestCmd.TestCmd(workdir='')
    test.subdir('sub')
    subdir1 = test.workpath('sub', 'dir1')
    subdir2 = test.workpath('sub', 'dir1', 'dir2')
    file = test.workpath('sub', 'dir1', 'dir2', 'file')
    # make sure it does error if asked to create a dir
    # where there's already a file
    os.makedirs(subdir2)
    test.write(file, "test\n")
    try:
        mkdir_func(file)
    except OSError as e:
        pass
    else:
        self.fail("expected OSError")