File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed
Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 99 quoted. Addresses :bbissue: `164 `.
1010- Add :ref: `command-wipeenv ` command for removing all packages
1111 installed in the virtualenv.
12+ - Allow users of ``virtualenvwrapper_lazy.sh `` to extend the list of
13+ API commands that trigger the lazy-loader by extending
14+ ``_VIRTUALENVWRAPPER_API ``. Patch contributed by John Purnell, see
15+ :bbissue: `188 `.
1216
13174.0
1418===
Original file line number Diff line number Diff line change 1+ # -*- mode: shell-script -*-
2+
3+ test_dir=$( cd $( dirname $0 ) && pwd)
4+ source " $test_dir /setup.sh"
5+
6+ oneTimeSetUp () {
7+ rm -rf " $WORKON_HOME "
8+ mkdir -p " $WORKON_HOME "
9+ [ ! -z " $ZSH_VERSION " ] && unsetopt shwordsplit
10+ }
11+
12+ oneTimeTearDown () {
13+ rm -rf " $WORKON_HOME "
14+ }
15+
16+ setUp () {
17+ echo
18+ rm -f " $test_dir /catch_output"
19+ }
20+
21+ function_defined_lazy () {
22+ name=" $1 "
23+ assertTrue " $name not defined" " type $name "
24+ assertTrue " $name does not load virtualenvwrapper" " typeset -f $name | grep 'virtualenvwrapper_load'"
25+ if [ " $name " = " mkvirtualenv" ]
26+ then
27+ lookfor=" rmvirtualenv"
28+ else
29+ lookfor=" mkvirtualenv"
30+ fi
31+ assertFalse " $name includes reference to $lookfor : $( typeset -f $name ) " " typeset -f $name | grep $lookfor "
32+ }
33+
34+ test_custom_defined_lazy () {
35+ _VIRTUALENVWRAPPER_API=" my_custom_command"
36+ source " $test_dir /../virtualenvwrapper_lazy.sh"
37+ function_defined_lazy my_custom_command
38+ }
39+
40+ . " $test_dir /shunit2"
Original file line number Diff line number Diff line change 11#! /bin/sh
22# Alternative startup script for faster login times.
33
4- export _VIRTUALENVWRAPPER_API=" mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv"
4+ export _VIRTUALENVWRAPPER_API=" $_VIRTUALENVWRAPPER_API mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv"
55
66if [ -z " $VIRTUALENVWRAPPER_SCRIPT " ]
77then
You can’t perform that action at this time.
0 commit comments