File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ oneTimeSetUp() {
99 unset VIRTUAL_ENV
1010 source " $test_dir /../virtualenvwrapper.sh"
1111 mkvirtualenv cd-test > /dev/null 2>&1
12+ mkvirtualenv " env with space" > /dev/null 2>&1
1213 deactivate
1314}
1415
@@ -38,6 +39,16 @@ test_cdvirtual() {
3839 virtualenvwrapper_cd " $start_dir "
3940}
4041
42+ test_cdvirtual_space_in_name () {
43+ workon " env with space"
44+ start_dir=" $( pwd) "
45+ cdvirtualenv
46+ assertSame " $VIRTUAL_ENV " " $( pwd) "
47+ cdvirtualenv bin
48+ assertSame " $VIRTUAL_ENV /bin" " $( pwd) "
49+ virtualenvwrapper_cd " $start_dir "
50+ }
51+
4152test_cdsitepackages () {
4253 start_dir=" $( pwd) "
4354 cdsitepackages
@@ -47,6 +58,16 @@ test_cdsitepackages () {
4758 virtualenvwrapper_cd " $start_dir "
4859}
4960
61+ test_cdsitepackages_space_in_name () {
62+ workon " env with space"
63+ start_dir=" $( pwd) "
64+ cdsitepackages
65+ pyvers=$( python -V 2>&1 | cut -f2 -d' ' | cut -f1-2 -d.)
66+ sitepackages=" $VIRTUAL_ENV /lib/python${pyvers} /site-packages"
67+ assertSame " $sitepackages " " $( pwd) "
68+ virtualenvwrapper_cd " $start_dir "
69+ }
70+
5071test_cdsitepackages_with_arg () {
5172 start_dir=" $( pwd) "
5273 pyvers=$( python -V 2>&1 | cut -f2 -d' ' | cut -f1-2 -d.)
Original file line number Diff line number Diff line change @@ -892,7 +892,7 @@ function cdsitepackages {
892892function cdvirtualenv {
893893 virtualenvwrapper_verify_workon_home || return 1
894894 virtualenvwrapper_verify_active_environment || return 1
895- virtualenvwrapper_cd $VIRTUAL_ENV /$1
895+ virtualenvwrapper_cd " $VIRTUAL_ENV " /$1
896896}
897897
898898# Shows the content of the site-packages directory of the currently-active
You can’t perform that action at this time.
0 commit comments