예제 #1
0
 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)
예제 #2
0
 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')
         ])
예제 #3
0
 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')
예제 #4
0
 def test_envVar_permissions(self, mock_file, mock_env):
     try:
         setEnvVars('development')
     except IOError:
         pass
     self.assertRaises(IOError)
예제 #5
0
 def test_envVar_permissions(self, mock_file, mock_env):
     with pytest.raises(IOError):
         setEnvVars('development')