diff options
Diffstat (limited to 'gitlab/tests')
-rw-r--r-- | gitlab/tests/test_config.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gitlab/tests/test_config.py b/gitlab/tests/test_config.py index 65bd300..681b3d1 100644 --- a/gitlab/tests/test_config.py +++ b/gitlab/tests/test_config.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import os import unittest import mock @@ -72,6 +73,16 @@ per_page = 200 """ +class TestEnvConfig(unittest.TestCase): + def test_env_present(self): + with mock.patch.dict(os.environ, {"PYTHON_GITLAB_CFG": "/some/path"}): + self.assertEqual(["/some/path"], config._env_config()) + + def test_env_missing(self): + with mock.patch.dict(os.environ, {}, clear=True): + self.assertEqual([], config._env_config()) + + class TestConfigParser(unittest.TestCase): @mock.patch("os.path.exists") def test_missing_config(self, path_exists): |