コード例 #1
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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
コード例 #2
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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
コード例 #3
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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
コード例 #4
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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
コード例 #5
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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
コード例 #6
0
ファイル: test_waffle.py プロジェクト: ntoll/django-waffle
 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