Skip to content

Commit 05a0e85

Browse files
committed
Add basic unit test with a TODO
1 parent 67d4b94 commit 05a0e85

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/virtualenv.vim

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
describe 'pymode-virtualenv'
2+
3+
before
4+
source plugin/pymode.vim
5+
set filetype=python
6+
end
7+
8+
after
9+
bd!
10+
end
11+
12+
" TODO: How can we mock the virtualenv activation to check that the
13+
" proper path is set to pymode_virtualenv_enabled? Right now, the
14+
" python function enable_virtualenv gets called but fails when trying
15+
" to actually activate so the env.let never gets called
16+
17+
it 'accepts relative paths'
18+
call pymode#virtualenv#activate("sample/relative/path")
19+
" Our path variable is the path argument
20+
Expect g:pymode_virtualenv_path == "sample/relative/path"
21+
end
22+
23+
it 'accepts absolute paths'
24+
call pymode#virtualenv#activate("/sample/absolute/path")
25+
" Our path variable is the path argument
26+
Expect g:pymode_virtualenv_path == "/sample/absolute/path"
27+
end
28+
end

0 commit comments

Comments
 (0)