Doug Hellmann | 94129c7 | 2017-01-09 21:24:24 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Tests for DevStack INI functions |
| 4 | |
| 5 | TOP=$(cd $(dirname "$0")/.. && pwd) |
| 6 | |
| 7 | source $TOP/functions-common |
| 8 | source $TOP/inc/python |
| 9 | |
| 10 | source $TOP/tests/unittest.sh |
| 11 | |
| 12 | echo "Testing Python 3 functions" |
| 13 | |
| 14 | # Initialize variables manipulated by functions under test. |
| 15 | export ENABLED_PYTHON3_PACKAGES="" |
| 16 | export DISABLED_PYTHON3_PACKAGES="" |
| 17 | |
| 18 | assert_false "should not be enabled yet" python3_enabled_for testpackage1 |
| 19 | |
| 20 | enable_python3_package testpackage1 |
| 21 | assert_equal "$ENABLED_PYTHON3_PACKAGES" "testpackage1" "unexpected result" |
| 22 | assert_true "should be enabled" python3_enabled_for testpackage1 |
| 23 | |
| 24 | assert_false "should not be disabled yet" python3_disabled_for testpackage2 |
| 25 | |
| 26 | disable_python3_package testpackage2 |
| 27 | assert_equal "$DISABLED_PYTHON3_PACKAGES" "testpackage2" "unexpected result" |
| 28 | assert_true "should be disabled" python3_disabled_for testpackage2 |
| 29 | |
| 30 | report_results |