def test_main_list(self, mock_prepare_inputs, mock_module, mock_list, mock_exit_json, mock_get_response):
		
		mock_prepare_inputs.return_value = ("","mockbin", {}, "list")
		mock_get_response.return_value = (True, requests.Response())
		main()

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

        mock_prepare_inputs.return_value = ("", "mockbin", {}, "list")
        mock_get_response.return_value = (True, requests.Response())
        main()

        assert mock_list.called
	def test_main_present(self, mock_prepare_inputs, mock_module, mock_add_or_update, mock_exit_json, mock_get_response):
		
		mock_prepare_inputs.return_value = ("","mockbin", {}, "present")
		mock_get_response.return_value = (True, requests.Response())
		main()

		assert mock_add_or_update.called
Ejemplo n.º 4
0
    def test_main_delete(self, mock_prepare_inputs, mock_module, mock_delete,
                         mock_exit_json, mock_get_response):

        mock_prepare_inputs.return_value = ("", "mockbin", {}, "absent", None,
                                            None)
        mock_get_response.return_value = (True, requests.Response())
        main()

        assert mock_delete.called
    def test_main_present(
        self, mock_prepare_inputs, mock_module, mock_add_or_update, mock_exit_json, mock_get_response
    ):

        mock_prepare_inputs.return_value = ("", "mockbin", {}, "present")
        mock_get_response.return_value = (True, requests.Response())
        main()

        assert mock_add_or_update.called