예제 #1
0
 def test_env_not_in_context(self):
     # The function returns None if JUJU_ENV is not included in the context.
     with mock.patch("os.environ", {}):
         self.assertIsNone(juju_env())
예제 #2
0
 def test_env_in_context(self):
     # The function returns the juju env if found in the execution context.
     with mock.patch("os.environ", {"JUJU_ENV": "test-env"}):
         self.assertEqual("test-env", juju_env())
예제 #3
0
 def test_env_not_in_context(self):
     # The function returns None if JUJU_ENV is not included in the context.
     with mock.patch('os.environ', {}):
         self.assertIsNone(juju_env())
예제 #4
0
 def test_env_in_context(self):
     # The function returns the juju env if found in the execution context.
     with mock.patch('os.environ', {'JUJU_ENV': 'test-env'}):
         self.assertEqual('test-env', juju_env())
예제 #5
0
 def test_env_in_context(self):
     # The function returns the juju env if found in the execution context.
     with mock.patch('os.environ', {'JUJU_ENV': 'test-env'}):
         self.assertEqual('test-env', juju_env())