예제 #1
0
	def test_main_delete(self, mock_prepare_inputs, mock_module, mock_delete, mock_exit_json, mock_get_response):

		mock_prepare_inputs.return_value = (mock_kong_admin_url, "1","joesoap", "absent", None, None)
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_delete.called		
예제 #2
0
	def test_main_delete(self, mock_prepare_inputs, mock_module, mock_delete, mock_exit_json, mock_get_response):

		mock_prepare_inputs.return_value = (mock_kong_admin_url, "1","joesoap", "absent", None, None, None, None)
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_delete.called		
	def test_main_list(self, mock_prepare_inputs, mock_module, mock_list, mock_exit_json, mock_get_response):

		mock_prepare_inputs.return_value = (mock_kong_admin_url, "1","joesoap", "list")
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_list.called				
예제 #4
0
	def test_main_list(self, mock_prepare_inputs, mock_module, mock_configure_for_plugin, mock_exit_json, mock_get_response):

		mock_prepare_inputs.return_value = (mock_kong_admin_url, "1","joesoap", "configure", "auth-key", {"key": "123"})
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_configure_for_plugin.called				

		expected_call = call('1', 'auth-key', {'key': '123'})
		assert mock_configure_for_plugin.call_args_list[0] == expected_call
예제 #5
0
	def test_main_list(self, mock_prepare_inputs, mock_module, mock_configure_for_plugin, mock_exit_json, mock_get_response):

		mock_prepare_inputs.return_value = (mock_kong_admin_url, "1","joesoap", "configure", "auth-key", {"key": "123"}, None, None)
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_configure_for_plugin.called				

		expected_call = call('1', 'auth-key', {'key': '123'})
		assert mock_configure_for_plugin.call_args_list[0] == expected_call