Exemplo n.º 1
0
 def test_parse_env_vars_nonexistent(self):
     """
     A none-existent environment variable will return an empty list.
     """
     with mock.patch('os.getenv', return_value=None) as patch:
         actual = waffle.parse_env_vars('foo')
         expected = []
         assert expected == actual
Exemplo n.º 2
0
 def test_parse_env_vars(self):
     """
     A comma-separated list of items is turned into a ordered list.
     """
     with mock.patch('os.getenv', return_value='foo,bar,baz') as patch:
         actual = waffle.parse_env_vars('foo')
         expected = ['foo', 'bar', 'baz']
         assert expected == actual
Exemplo n.º 3
0
 def test_parse_env_vars_nonexistent(self):
     """
     A none-existent environment variable will return an empty list.
     """
     with mock.patch('os.getenv', return_value=None) as patch:
         actual = waffle.parse_env_vars('foo')
         expected = []
         assert expected == actual
Exemplo n.º 4
0
 def test_parse_env_vars(self):
     """
     A comma-separated list of items is turned into a ordered list.
     """
     with mock.patch('os.getenv', return_value='foo,bar,baz') as patch:
         actual = waffle.parse_env_vars('foo')
         expected = ['foo', 'bar', 'baz']
         assert expected == actual
Exemplo n.º 5
0
 def test_parse_env_vars_malformed(self):
     """
     A malformed comma-separated list is "mended" appropriately (empty
     entries are ignored).
     """
     with mock.patch('os.getenv', return_value='foo,,baz') as patch:
         actual = waffle.parse_env_vars('foo')
         expected = ['foo', 'baz']
         assert expected == actual
Exemplo n.º 6
0
 def test_parse_env_vars_malformed(self):
     """
     A malformed comma-separated list is "mended" appropriately (empty
     entries are ignored).
     """
     with mock.patch('os.getenv', return_value='foo,,baz') as patch:
         actual = waffle.parse_env_vars('foo')
         expected = ['foo', 'baz']
         assert expected == actual