def test_default(self): self.assertEqual(parsenvy.set('SET_NONE', set([1, 2])), set([1, 2]))
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']))
def test_none(self): self.assertIsNone(parsenvy.set('SET_NONE')) os.environ['SET_EMPTY'] = '' self.assertIsNone(parsenvy.set('SET_EMPTY'))
def test_set_one(monkeypatch): monkeypatch.setenv("foo", "bar") assert parsenvy.set("foo") == {"bar"}
def test_set_several(monkeypatch): monkeypatch.setenv("foo", "bar,baz,barf") assert parsenvy.set("foo") == {"bar", "baz", "barf"}
def test_set_empty(monkeypatch): monkeypatch.setenv("foo", "") assert parsenvy.set("foo", {"bar"}) == {"bar"}
def test_set_multiple_commas(monkeypatch): monkeypatch.setenv("foo", ",,,") assert parsenvy.set("foo") == {"", "", "", ""}
def test_set_one_comma(monkeypatch): monkeypatch.setenv("foo", ",") assert parsenvy.set("foo") == {"", ""}