def test_cwd_with_absolute_paths():
 existing = '/some/existing/path'
 additional = 'another'
 absolute = '/absolute/path'
 with settings(cwd=existing):
  with cd(absolute):
   eq_(env.cwd, absolute)
  with cd(additional):
   eq_(env.cwd, ((existing + '/') + additional))

def test_cwd_with_absolute_paths ( ) : existing = '/some/existing/path' additional = 'another' absolute = '/absolute/path' with settings ( cwd = existing ) : with cd ( absolute ) : eq_ ( env . cwd , absolute ) with cd ( additional ) : eq_ ( env . cwd , ( ( existing + '/' ) + additional ) )
cd() should append arg if non-absolute or overwrite otherwise .