~ubuntu-branches/ubuntu/trusty/virtualenvwrapper/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/test_mktmpenv.sh~

  • Committer: Package Import Robot
  • Author(s): Jan Dittberner
  • Date: 2012-05-17 14:24:08 UTC
  • mfrom: (1.2.15)
  • Revision ID: package-import@ubuntu.com-20120517142408-5dexv6w1cldbzx3j
Tags: 3.3-1
* New upstream version
* change Build-Depends for dh_sphinxdoc to python-sphinx (>=
  1.0.7+dfsg) | python3-sphinx
* bump Standards-Version to 3.9.3 (no changes)
* refresh debian/patches/debianspecific-setup.py.patch
* use symlinks for duplicated ajax-loader.gif
* Fix "FTBFS if built twice in a row: virtualenvwrapper/__init__.pyc:
  binary file contents changed" by removing *.pyc in clean target
  (Closes: #641735)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
test_dir=$(cd $(dirname $0) && pwd)
 
4
 
 
5
export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
 
6
 
 
7
 
 
8
oneTimeSetUp() {
 
9
    rm -rf "$WORKON_HOME"
 
10
    mkdir -p "$WORKON_HOME"
 
11
    source "$test_dir/../virtualenvwrapper.sh"
 
12
}
 
13
 
 
14
oneTimeTearDown() {
 
15
    rm -rf "$WORKON_HOME"
 
16
}
 
17
 
 
18
setUp () {
 
19
    echo
 
20
    rm -f "$test_dir/catch_output"
 
21
}
 
22
 
 
23
test_mktmpenv_no_name() {
 
24
    before=$(lsvirtualenv -b)
 
25
    mktmpenv >/dev/null 2>&1
 
26
    after=$(lsvirtualenv -b)
 
27
    assertFalse "Environment was not created" "[ \"$before\" = \"$after\" ]"
 
28
}
 
29
 
 
30
test_mktmpenv_name() {
 
31
    mktmpenv name-given-by-user >/dev/null 2>&1
 
32
    RC=$?
 
33
    assertTrue "Error was not detected" "[ $RC -ne 0 ]"
 
34
}
 
35
 
 
36
test_mktmpenv_virtualenv_args() {
 
37
    mktmpenv --no-site-packages >/dev/null 2>&1
 
38
    ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt"
 
39
    assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]"
 
40
}
 
41
 
 
42
test_deactivate() {
 
43
    mktmpenv >/dev/null 2>&1
 
44
    assertTrue "Environment was not created" "[ ! -z \"$VIRTUAL_ENV\" ]"
 
45
    env_name=$(basename "$VIRTUAL_ENV")
 
46
    deactivate >/dev/null 2>&1
 
47
    assertFalse "Environment still exists" "[ -d \"$WORKON_HOME/$env_name\" ]"
 
48
}
 
49
 
 
50
. "$test_dir/shunit2"