summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBorge Lanes <borgel@snap.tv>2014-12-10 22:37:30 +0100
committerBorge Lanes <borgel@snap.tv>2014-12-10 22:37:30 +0100
commita38d68b06cf4e712384ef3531f0abaa5a00e5aff (patch)
treef890bceee96a12fca49c34837513ba15b1d8f837 /tests
parent441f908c8a28dbc231516a607d594ad104edd86c (diff)
downloadtox-a38d68b06cf4e712384ef3531f0abaa5a00e5aff.tar.gz
Add test for getcontextname()
Diffstat (limited to 'tests')
-rw-r--r--tests/test_config.py14
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("""