コード例 #1
0
from xonsh.built_ins import reglob, pathsearch, helper, superhelper, \
    ensure_list_of_strs, list_of_strs_or_callables, regexsearch, \
    globsearch, expand_path, convert_macro_arg, macro_context, call_macro
from xonsh.environ import Env

from tools import skip_if_on_windows

HOME_PATH = os.path.expanduser('~')


@pytest.fixture(autouse=True)
def xonsh_execer_autouse(xonsh_execer):
    return xonsh_execer


@pytest.mark.parametrize('testfile', reglob('test_.*'))
def test_reglob_tests(testfile):
    assert (testfile.startswith('test_'))


@pytest.fixture
def home_env(xonsh_builtins):
    """Set `__xonsh_env__ ` to a new Env instance on `xonsh_builtins`"""
    xonsh_builtins.__xonsh_env__ = Env(HOME=HOME_PATH)
    return xonsh_builtins


@skip_if_on_windows
def test_repath_backslash(home_env):
    exp = os.listdir(HOME_PATH)
    exp = {p for p in exp if re.match(r'\w\w.*', p)}
コード例 #2
0
ファイル: test_builtins.py プロジェクト: CJ-Wright/xonsh
def test_reglob_tests():
    testfiles = reglob('test_.*')
    for f in testfiles:
        assert_true(f.startswith('test_'))
コード例 #3
0
def test_reglob_tests():
    testfiles = reglob('test_.*')
    for f in testfiles:
        assert_true(f.startswith('test_'))
コード例 #4
0
ファイル: test_builtins.py プロジェクト: sthagen/xonsh
    regexsearch,
    reglob,
    superhelper,
)
from xonsh.environ import Env
from xonsh.pytest.tools import skip_if_on_windows

HOME_PATH = os.path.expanduser("~")


@pytest.fixture(autouse=True)
def xonsh_execer_autouse(xonsh_execer):
    return xonsh_execer


@pytest.mark.parametrize("testfile", reglob("test_.*"))
def test_reglob_tests(testfile):
    assert testfile.startswith("test_")


@pytest.fixture
def home_env(xession):
    """Set `__xonsh__.env ` to a new Env instance on `xonsh_builtins`"""
    xession.env["HOME"] = HOME_PATH
    return xession


@skip_if_on_windows
def test_repath_backslash(home_env):
    exp = os.listdir(HOME_PATH)
    exp = {p for p in exp if re.match(r"\w\w.*", p)}
コード例 #5
0
ファイル: test_builtins.py プロジェクト: jhdulaney/xonsh
from xonsh.built_ins import reglob, pathsearch, helper, superhelper, \
    ensure_list_of_strs, list_of_strs_or_callables, regexsearch, \
    globsearch, convert_macro_arg, macro_context, call_macro
from xonsh.environ import Env

from tools import skip_if_on_windows


HOME_PATH = os.path.expanduser('~')


@pytest.fixture(autouse=True)
def xonsh_execer_autouse(xonsh_execer):
    return xonsh_execer

@pytest.mark.parametrize('testfile', reglob('test_.*'))
def test_reglob_tests(testfile):
    assert (testfile.startswith('test_'))


@pytest.fixture
def home_env(xonsh_builtins):
    """Set `__xonsh_env__ ` to a new Env instance on `xonsh_builtins`"""
    xonsh_builtins.__xonsh_env__ = Env(HOME=HOME_PATH)
    return xonsh_builtins


@skip_if_on_windows
def test_repath_backslash(home_env):
    exp = os.listdir(HOME_PATH)
    exp = {p for p in exp if re.match(r'\w\w.*', p)}
コード例 #6
0
ファイル: test_builtins.py プロジェクト: lmmx/xonsh
def test_reglob_tests():
    testfiles = reglob("test_.*")
    for f in testfiles:
        assert_true(f.startswith("test_"))
コード例 #7
0
ファイル: test_builtins.py プロジェクト: ericmharris/xonsh
    enter_macro,
)
from xonsh.environ import Env

from tools import skip_if_on_windows


HOME_PATH = os.path.expanduser("~")


@pytest.fixture(autouse=True)
def xonsh_execer_autouse(xonsh_execer):
    return xonsh_execer


@pytest.mark.parametrize("testfile", reglob("test_.*"))
def test_reglob_tests(testfile):
    assert testfile.startswith("test_")


@pytest.fixture
def home_env(xonsh_builtins):
    """Set `__xonsh__.env ` to a new Env instance on `xonsh_builtins`"""
    xonsh_builtins.__xonsh__.env = Env(HOME=HOME_PATH)
    return xonsh_builtins


@skip_if_on_windows
def test_repath_backslash(home_env):
    exp = os.listdir(HOME_PATH)
    exp = {p for p in exp if re.match(r"\w\w.*", p)}