def test_envVar_success(self, mock_file, mock_env):
     setEnvVars('development')
     envCalls = [
         call('development', 'config/{}.yaml'),
         call('development', None)
     ]
     mock_env.assert_has_calls(envCalls)
 def test_envVar_parsing(self, mock_env):
     m = mock_open()
     with patch('builtins.open', m, create=True):
         setEnvVars('development')
         confHandle = m()
         confHandle.write.assert_has_calls([
             call('environment_variables:\n  jerry: hello\n  test: world\n')
         ])
 def test_missing_block(self, mock_copy, mock_env):
     setEnvVars('development')
     mock_env.assert_called_once()
     mock_copy.assert_called_once_with('config.yaml', 'run_config.yaml')
 def test_envVar_permissions(self, mock_file, mock_env):
     try:
         setEnvVars('development')
     except IOError:
         pass
     self.assertRaises(IOError)
Beispiel #5
0
 def test_envVar_permissions(self, mock_file, mock_env):
     with pytest.raises(IOError):
         setEnvVars('development')