Beispiel #1
0
 def test_default(self):
     self.assertEqual(parsenvy.set('SET_NONE', set([1, 2])), set([1, 2]))
Beispiel #2
0
 def test_set(self):
     os.environ['SET_A_B_C'] = 'a,b,c'
     self.assertEqual(parsenvy.set('SET_A_B_C'), set(['a', 'b', 'c']))
Beispiel #3
0
    def test_none(self):
        self.assertIsNone(parsenvy.set('SET_NONE'))

        os.environ['SET_EMPTY'] = ''
        self.assertIsNone(parsenvy.set('SET_EMPTY'))
Beispiel #4
0
def test_set_one(monkeypatch):
    monkeypatch.setenv("foo", "bar")
    assert parsenvy.set("foo") == {"bar"}
Beispiel #5
0
def test_set_several(monkeypatch):
    monkeypatch.setenv("foo", "bar,baz,barf")
    assert parsenvy.set("foo") == {"bar", "baz", "barf"}
Beispiel #6
0
def test_set_empty(monkeypatch):
    monkeypatch.setenv("foo", "")
    assert parsenvy.set("foo", {"bar"}) == {"bar"}
Beispiel #7
0
def test_set_multiple_commas(monkeypatch):
    monkeypatch.setenv("foo", ",,,")
    assert parsenvy.set("foo") == {"", "", "", ""}
Beispiel #8
0
def test_set_one_comma(monkeypatch):
    monkeypatch.setenv("foo", ",")
    assert parsenvy.set("foo") == {"", ""}