Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

avoid panic on tx.commit calls #55

Merged
merged 3 commits into from
Jul 21, 2020
Merged

avoid panic on tx.commit calls #55

merged 3 commits into from
Jul 21, 2020

Conversation

arxdsilva
Copy link
Member

Hey guys,

While using this mock pkg I came across a commit panic when the mock tx was used to commit. I made a branch that shows how this panic occurs (here).

This PR does:

  • makes Mock struct implement the driver.Driver interface
  • registers a new driver "mock" on New
  • returns a fake db tx on mock.GetTransaction
  • implements mockConn that allows Mock{} to return a mocked connection

@sourcelevel-bot
Copy link

Hello, @arxdsilva! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

m: register mockDriver
add TestMock_GetTransaction
move mockDriver to Mock
driver > conn
@felipeweb felipeweb merged commit b64238c into prest:master Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants