'Change the current working directory to the specified path.
Path can be a string or a py.path.local object.'

def chdir(self, path):

    if (self._cwd is None):
        self._cwd = os.getcwd()
    if hasattr(path, 'chdir'):
        path.chdir()
    else:
        os.chdir(path)
