File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -52,4 +52,24 @@ test_virtualenvwrapper_verify_project_home_missing_dir() {
5252 PROJECT_HOME=" $old_home "
5353}
5454
55+ test_virtualenvwrapper_postactivate_hook () {
56+ load_wrappers
57+ mkproject " test_project_hook"
58+ mkdir .virtualenvwrapper
59+ echo " export TEST_PROJECT_HOOK_VAR=true" > .virtualenvwrapper/postactivate
60+ echo " unset TEST_PROJECT_HOOK_VAR" > .virtualenvwrapper/predeactivate
61+ deactivate
62+
63+ # Variable should not be set to start
64+ assertSame " ${TEST_PROJECT_HOOK_VAR} " " "
65+
66+ # Activating the env should set it
67+ workon " test_project_hook"
68+ assertSame " true" " ${TEST_PROJECT_HOOK_VAR} "
69+
70+ # Deactivating should unset it
71+ deactivate
72+ assertSame " " " ${TEST_PROJECT_HOOK_VAR} "
73+ }
74+
5575. " $test_dir /shunit2"
You can’t perform that action at this time.
0 commit comments