Example #1
0
def test_list_one(monkeypatch):
    monkeypatch.setenv("foo", "bar")
    assert parsenvy.list("foo") == ["bar"]
Example #2
0
def test_list_empty(monkeypatch):
    monkeypatch.setenv("foo", "")
    assert parsenvy.list("foo", ["bar"]) == ["bar"]
Example #3
0
def test_list_several(monkeypatch):
    monkeypatch.setenv("foo", "bar,baz,barf")
    assert parsenvy.list("foo") == ["bar", "baz", "barf"]
Example #4
0
def test_list_multiple_commas(monkeypatch):
    monkeypatch.setenv("foo", ",,,")
    assert parsenvy.list("foo") == ["", "", "", ""]
Example #5
0
def test_list_one_comma(monkeypatch):
    monkeypatch.setenv("foo", ",")
    assert parsenvy.list("foo") == ["", ""]
Example #6
0
 def test_default(self):
     self.assertEqual(parsenvy.list('LIST_NONE', [1, 2]), [1, 2])
Example #7
0
    def test_none(self):
        self.assertIsNone(parsenvy.list('LIST_NONE'))

        os.environ['LIST_EMPTY'] = ''
        self.assertIsNone(parsenvy.list('LIST_EMPTY'))
Example #8
0
 def test_list(self):
     os.environ['LIST_A_B_C'] = 'a,b,c'
     self.assertEqual(parsenvy.list('LIST_A_B_C'), ['a', 'b', 'c'])