Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend support for batch operation mocking / assertions #150

Closed
wants to merge 2 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Aug 16, 2023

Description

This PR extends the support for batch operation mocking and assertions in the pgxmock package. It modifies the SendBatch method to allow mocking and asserting batch operations. Additionally, it adds tests to ensure the correctness of the new functionality.

Summary

  • Modified the SendBatch method in pgxmock.go to support mocking and asserting batch operations.
  • Created a new type, mockBatchResults, to represent a batch operation and implemented the pgx.BatchResults interface for this type.
  • Updated the SendBatch method to create a new mockBatchResults instance, execute all the queries in the batch, and return the mockBatchResults instance.
  • Added a new test function, TestSendBatch, in pgxmock_test.go to test the SendBatch method and ensure its correctness.

Fixes #149.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/extend-batch-mocking

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 16, 2023
@pashagolub pashagolub closed this Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Extend support for batch operation mocking / assertions
1 participant