File: test_lazy.sh

package info (click to toggle)
virtualenvwrapper 4.8.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 796 kB
  • sloc: sh: 3,369; python: 595; makefile: 185
file content (107 lines) | stat: -rwxr-xr-x 2,244 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# -*- mode: shell-script -*-

test_dir=$(cd $(dirname $0) && pwd)
source "$test_dir/setup.sh"

oneTimeSetUp() {
    rm -rf "$WORKON_HOME"
    mkdir -p "$WORKON_HOME"
    [ ! -z "$ZSH_VERSION" ] && unsetopt shwordsplit
    source "$test_dir/../virtualenvwrapper_lazy.sh"
    [ ! -z "$ZSH_VERSION" ] && setopt shwordsplit
}

oneTimeTearDown() {
    rm -rf "$WORKON_HOME"
}

setUp () {
    echo
}

function_defined_lazy() {
    name="$1"
    assertTrue "$name not defined" "type $name"
	assertTrue "$name does not load virtualenvwrapper" "typeset -f $name | grep 'virtualenvwrapper_load'"
    if [ "$name" = "mkvirtualenv" ]
    then
        lookfor="rmvirtualenv"
    else
        lookfor="mkvirtualenv"
    fi
	assertFalse "$name includes reference to $lookfor: $(typeset -f $name)" "typeset -f $name | grep $lookfor"
}

test_mkvirtualenv_defined_lazy() {
    function_defined_lazy mkvirtualenv
}

test_rmvirtualenv_defined_lazy() {
    function_defined_lazy rmvirtualenv
}

test_lsvirtualenv_defined_lazy() {
    function_defined_lazy lsvirtualenv
}

test_showvirtualenv_defined_lazy() {
    function_defined_lazy showvirtualenv
}

test_workon_defined_lazy() {
    function_defined_lazy workon
}

test_add2virtualenv_defined_lazy() {
    function_defined_lazy add2virtualenv
}

test_cdsitepackages_defined_lazy() {
    function_defined_lazy cdsitepackages
}

test_cdvirtualenv_defined_lazy() {
    function_defined_lazy cdvirtualenv
}

test_cdvirtualenv_defined_lazy() {
    function_defined_lazy cdvirtualenv
}

test_lssitepackages_defined_lazy() {
    function_defined_lazy lssitepackages
}

test_toggleglobalsitepackages_defined_lazy() {
    function_defined_lazy toggleglobalsitepackages
}

test_cpvirtualenv_defined_lazy() {
    function_defined_lazy cpvirtualenv
}

test_setvirtualenvproject_defined_lazy() {
    function_defined_lazy setvirtualenvproject
}

test_mkproject_defined_lazy() {
    function_defined_lazy mkproject
}

test_cdproject_defined_lazy() {
    function_defined_lazy cdproject
}

test_mktmpenv_defined_lazy() {
    function_defined_lazy mktmpenv
}

test_wipeenv_defined_lazy() {
    function_defined_lazy wipeenv
}

test_allvirtualenv_defined_lazy() {
    function_defined_lazy allvirtualenv
}

. "$test_dir/shunit2"