-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6024 from edx/clytwynec/fix_no_prereq_install
fix NO_PREREQ_INSTALL
- Loading branch information
Showing
2 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
import os | ||
import unittest | ||
from pavelib.prereqs import no_prereq_install | ||
|
||
|
||
class TestPaverPrereqInstall(unittest.TestCase): | ||
|
||
def check_val(self, set_val, expected_val): | ||
_orig_environ = dict(os.environ) | ||
os.environ['NO_PREREQ_INSTALL'] = set_val | ||
self.assertEqual( | ||
no_prereq_install(), | ||
expected_val, | ||
'NO_PREREQ_INSTALL is set to {}, but we read it as {}'.format( | ||
set_val, expected_val), | ||
) | ||
|
||
# Reset Environment back to original state | ||
os.environ.clear() | ||
os.environ.update(_orig_environ) | ||
|
||
def test_no_prereq_install_true(self): | ||
self.check_val('true', True) | ||
|
||
def test_no_prereq_install_false(self): | ||
self.check_val('false', False) | ||
|
||
def test_no_prereq_install_True(self): | ||
self.check_val('True', True) | ||
|
||
def test_no_prereq_install_False(self): | ||
self.check_val('False', False) | ||
|
||
def test_no_prereq_install_0(self): | ||
self.check_val('0', False) | ||
|
||
def test_no_prereq_install_1(self): | ||
self.check_val('1', True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters