update tests appropriately

This commit is contained in:
adam j hartz 2016-06-06 22:08:17 -04:00
parent 2076aac5de
commit d474f10818

View file

@ -35,20 +35,21 @@ def xonsh_env(env):
def test_simple():
load_builtins()
with chdir(PARENT):
assert_not_equal(os.getcwd(), HERE)
dirstack.cd(["tests"])
assert_equal(os.getcwd(), HERE)
with xonsh_env(Env(CDPATH=PARENT, PWD=PARENT)):
with chdir(PARENT):
assert_not_equal(os.getcwd(), HERE)
dirstack.cd(["tests"])
assert_equal(os.getcwd(), HERE)
def test_cdpath_simple():
with xonsh_env(Env(CDPATH=PARENT)):
with xonsh_env(Env(CDPATH=PARENT, PWD=HERE)):
with chdir(os.path.normpath("/")):
assert_not_equal(os.getcwd(), HERE)
dirstack.cd(["tests"])
assert_equal(os.getcwd(), HERE)
def test_cdpath_collision():
with xonsh_env(Env(CDPATH=PARENT)):
with xonsh_env(Env(CDPATH=PARENT, PWD=HERE)):
sub_tests = os.path.join(HERE, "tests")
if not os.path.exists(sub_tests):
os.mkdir(sub_tests)