Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use node instead of nodejs #275

Merged
merged 2 commits into from
Nov 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions tests/nodeenv_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@
HERE = os.path.abspath(os.path.dirname(__file__))


if subprocess.run(["which", "nodejs"],capture_output=True).returncode == 0:
is_nodejs = True
else:
is_nodejs = False


def call_nodejs(ev_path):
assert os.path.exists(ev_path)
activate = pipes.quote(os.path.join(ev_path, 'bin', 'activate'))
if is_nodejs:
subprocess.check_call([
'sh', '-c', '. {} && nodejs --version'.format(activate),
])
else:
subprocess.check_call([
'sh', '-c', '. {} && node --version'.format(activate),
])


@pytest.mark.integration
def test_smoke(tmpdir):
nenv_path = tmpdir.join('nenv').strpath
Expand All @@ -43,7 +24,11 @@ def test_smoke(tmpdir):
'coverage', 'run', '-p',
'-m', 'nodeenv', '--prebuilt', nenv_path,
])
call_nodejs(nenv_path)
assert os.path.exists(nenv_path)
activate = pipes.quote(os.path.join(nenv_path, 'bin', 'activate'))
subprocess.check_call([
'sh', '-c', '. {} && node --version'.format(activate),
])


@pytest.mark.integration
Expand All @@ -54,7 +39,11 @@ def test_smoke_n_system_special_chars(tmpdir):
'coverage', 'run', '-p',
'-m', 'nodeenv', '-n', 'system', nenv_path,
))
call_nodejs(nenv_path)
assert os.path.exists(nenv_path)
activate = pipes.quote(os.path.join(nenv_path, 'bin', 'activate'))
subprocess.check_call([
'sh', '-c', '. {} && node --version'.format(activate),
])


@pytest.yield_fixture
Expand Down