Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,10 @@ def main():
}

SHIM = """#!/usr/bin/env bash
export NODE_PATH=__NODE_VIRTUAL_ENV__/lib/node_modules
export NPM_CONFIG_PREFIX=__NODE_VIRTUAL_ENV__
export npm_config_prefix=__NODE_VIRTUAL_ENV__
exec __SHIM_NODE__ "$@"
export NODE_PATH='__NODE_VIRTUAL_ENV__/lib/node_modules'
export NPM_CONFIG_PREFIX='__NODE_VIRTUAL_ENV__'
export npm_config_prefix='__NODE_VIRTUAL_ENV__'
exec '__SHIM_NODE__' "$@"
"""

ACTIVATE_BAT = r"""
Expand Down
19 changes: 18 additions & 1 deletion tests/nodeenv_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import unicode_literals

import os.path
import pipes
import subprocess
import sys

Expand All @@ -23,8 +24,24 @@ def test_smoke(tmpdir):
'-m', 'nodeenv', '--prebuilt', nenv_path,
])
assert os.path.exists(nenv_path)
activate = pipes.quote(os.path.join(nenv_path, 'bin', 'activate'))
subprocess.check_call([
'sh', '-c', '. {0}/bin/activate && nodejs --version'.format(nenv_path),
'sh', '-c', '. {} && nodejs --version'.format(activate),
])


@pytest.mark.integration
@pytest.mark.skipif(sys.platform == 'win32', reason='-n system is posix only')
def test_smoke_n_system_special_chars(tmpdir):
nenv_path = tmpdir.join('nenv (production env)').strpath
subprocess.check_call((
'coverage', 'run', '-p',
'-m', 'nodeenv', '-n', 'system', nenv_path,
))
assert os.path.exists(nenv_path)
activate = pipes.quote(os.path.join(nenv_path, 'bin', 'activate'))
subprocess.check_call([
'sh', '-c', '. {} && nodejs --version'.format(activate),
])


Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ deps =
sphinx
changedir = docs
commands = sphinx-build -b html -d build/doctrees source build/html

[pytest]
markers =
integration: tests that take a little bit longer