mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
update tests for new aliasing
This commit is contained in:
parent
2bc5c3b1f1
commit
36ba1b14bf
3 changed files with 8 additions and 1 deletions
|
@ -2,10 +2,13 @@
|
|||
"""Testing built_ins.Aliases"""
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
import os
|
||||
import nose
|
||||
from nose.tools import assert_equal
|
||||
|
||||
import xonsh.built_ins as built_ins
|
||||
from xonsh.built_ins import Aliases
|
||||
from xonsh.environ import Env
|
||||
|
||||
|
||||
def cd(args, stdin=None):
|
||||
|
@ -37,6 +40,7 @@ def test_eval_recursive():
|
|||
assert_equal(ALIASES.get('color_ls'), ['ls', '- -', '--color=true'])
|
||||
|
||||
def test_eval_recursive_callable_partial():
|
||||
built_ins.ENV = Env(HOME=os.path.expanduser('~'))
|
||||
assert_equal(ALIASES.get('indirect_cd')(['arg2', 'arg3']),
|
||||
['..', 'arg2', 'arg3'])
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ def test_repath_backslash():
|
|||
if ON_WINDOWS:
|
||||
raise SkipTest
|
||||
home = os.path.expanduser('~')
|
||||
built_ins.ENV = Env(HOME=home)
|
||||
exp = os.listdir(home)
|
||||
exp = {p for p in exp if re.match(r'\w\w.*', p)}
|
||||
exp = {os.path.join(home, p) for p in exp}
|
||||
|
@ -32,12 +33,14 @@ def test_repath_backslash():
|
|||
|
||||
def test_repath_home_itself():
|
||||
exp = os.path.expanduser('~')
|
||||
built_ins.ENV = Env(HOME=exp)
|
||||
obs = regexpath('~')
|
||||
assert_equal(1, len(obs))
|
||||
assert_equal(exp, obs[0])
|
||||
|
||||
def test_repath_home_contents():
|
||||
home = os.path.expanduser('~')
|
||||
built_ins.ENV = Env(HOME=home)
|
||||
exp = os.listdir(home)
|
||||
exp = {os.path.join(home, p) for p in exp}
|
||||
obs = set(regexpath('~/.*'))
|
||||
|
|
|
@ -14,7 +14,7 @@ from xonsh.replay import Replayer
|
|||
|
||||
from tools import ON_MAC, skip_if
|
||||
|
||||
SHELL = Shell()
|
||||
SHELL = Shell({'PATH': []})
|
||||
HISTDIR = os.path.join(os.path.dirname(__file__), 'histories')
|
||||
|
||||
def run_replay(re_file):
|
||||
|
|
Loading…
Add table
Reference in a new issue