예제 #1
0
def test_source_path(mockopen, mocked_execx_checker, patch_locate_binary,
                     xession):
    patch_locate_binary(xession.commands_cache)

    source_alias(["foo", "bar"])
    path_foo = os.path.join("bin", "foo")
    path_bar = os.path.join("bin", "bar")
    assert mocked_execx_checker[0].endswith(path_foo)
    assert mocked_execx_checker[1].endswith(path_bar)
예제 #2
0
def test_source_current_dir(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())
    monkeypatch.setattr(builtins, 'execx', mocked_execx)
    monkeypatch.setattr(os.path, 'isfile', lambda x: True)
    source_alias(['foo', 'bar'])
    assert checker == ['foo', 'bar']
예제 #3
0
def test_source_current_dir(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())

    monkeypatch.setattr(builtins, "execx", mocked_execx)
    monkeypatch.setattr(os.path, "isfile", lambda x: True)
    source_alias(["foo", "bar"])
    assert checker == ["foo", "bar"]
예제 #4
0
def test_source_current_dir(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())

    monkeypatch.setattr(builtins, 'execx', mocked_execx)
    monkeypatch.setattr(os.path, 'isfile', lambda x: True)
    source_alias(['foo', 'bar'])
    assert checker == ['foo', 'bar']
예제 #5
0
def test_source_path(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())
    monkeypatch.setattr(builtins, 'execx', mocked_execx)
    source_alias(['foo', 'bar'])
    path_foo = os.path.join('tests', 'bin', 'foo')
    path_bar = os.path.join('tests', 'bin', 'bar')
    assert checker[0].endswith(path_foo)
    assert checker[1].endswith(path_bar)
예제 #6
0
def test_source_path(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())

    monkeypatch.setattr(builtins, "execx", mocked_execx)
    source_alias(["foo", "bar"])
    path_foo = os.path.join("tests", "bin", "foo")
    path_bar = os.path.join("tests", "bin", "bar")
    assert checker[0].endswith(path_foo)
    assert checker[1].endswith(path_bar)
예제 #7
0
def test_source_path(mockopen, monkeypatch):
    checker = []

    def mocked_execx(src, *args, **kwargs):
        checker.append(src.strip())

    monkeypatch.setattr(builtins, 'execx', mocked_execx)
    source_alias(['foo', 'bar'])
    path_foo = os.path.join('tests', 'bin', 'foo')
    path_bar = os.path.join('tests', 'bin', 'bar')
    assert checker[0].endswith(path_foo)
    assert checker[1].endswith(path_bar)
예제 #8
0
def test_source_path(mockopen, mocked_execx_checker):
    source_alias(["foo", "bar"])
    path_foo = os.path.join("tests", "bin", "foo")
    path_bar = os.path.join("tests", "bin", "bar")
    assert mocked_execx_checker[0].endswith(path_foo)
    assert mocked_execx_checker[1].endswith(path_bar)
예제 #9
0
def test_source_current_dir(mockopen, monkeypatch, mocked_execx_checker):
    monkeypatch.setattr(os.path, "isfile", lambda x: True)
    source_alias(["foo", "bar"])
    assert mocked_execx_checker == ["foo", "bar"]