diff options
author | Borge Lanes <borgel@snap.tv> | 2014-12-10 22:37:30 +0100 |
---|---|---|
committer | Borge Lanes <borgel@snap.tv> | 2014-12-10 22:37:30 +0100 |
commit | a38d68b06cf4e712384ef3531f0abaa5a00e5aff (patch) | |
tree | f890bceee96a12fca49c34837513ba15b1d8f837 | |
parent | 441f908c8a28dbc231516a607d594ad104edd86c (diff) | |
download | tox-a38d68b06cf4e712384ef3531f0abaa5a00e5aff.tar.gz |
Add test for getcontextname()
-rw-r--r-- | tests/test_config.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 461b7b6..1c58a4a 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -148,6 +148,20 @@ def test_get_homedir(monkeypatch): assert get_homedir() == "123" +class TestGetcontextname: + def test_blank(self, monkeypatch): + monkeypatch.setattr(os, "environ", {}) + assert getcontextname() is None + + def test_jenkins(self, monkeypatch): + monkeypatch.setattr(os, "environ", {"JENKINS_URL": "xyz"}) + assert getcontextname() == "jenkins" + + def test_hudson_legacy(self, monkeypatch): + monkeypatch.setattr(os, "environ", {"HUDSON_URL": "xyz"}) + assert getcontextname() == "jenkins" + + class TestIniParser: def test_getdefault_single(self, tmpdir, newconfig): config = newconfig(""" |