diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-02 10:18:41 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-02 10:18:41 -0500 |
| commit | 018083b9259c2265ad3ea2432f315641e5b996ce (patch) | |
| tree | 455ecf9fb4ccf12f9634e6e54fb8a9e73e162220 /internal/bolttest | |
| parent | Improve coverage for separate Tx methods (diff) | |
| download | cli-018083b9259c2265ad3ea2432f315641e5b996ce.zip | |
Clean up fs repo and fs repo tests
Diffstat (limited to 'internal/bolttest')
| -rw-r--r-- | internal/bolttest/mock_migration_fs_repo.go | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/internal/bolttest/mock_migration_fs_repo.go b/internal/bolttest/mock_migration_fs_repo.go index 0932b37..ae933e3 100644 --- a/internal/bolttest/mock_migration_fs_repo.go +++ b/internal/bolttest/mock_migration_fs_repo.go @@ -5,10 +5,6 @@ import "github.com/eugenetriguba/bolt/internal/models" type MockMigrationFsRepo struct { CreateReturnValue CreateReturnValue CreateCallCount int - ExistsReturnValue ExistsReturnValue - ExistsCallCount int - GetReturnValue GetReturnValue - GetCallCount int ListReturnValue ListReturnValue ListCallCount int LatestReturnValue LatestReturnValue @@ -23,18 +19,11 @@ type CreateReturnValue struct { Err error } -type ExistsReturnValue struct { - Exists bool - Err error -} - -type GetReturnValue struct { +type LatestReturnValue struct { Migration *models.Migration Err error } -type LatestReturnValue = GetReturnValue - type ReadUpgradeScriptReturnValue struct { ScriptContents string Err error @@ -47,16 +36,6 @@ func (repo *MockMigrationFsRepo) Create(migration *models.Migration) error { return repo.CreateReturnValue.Err } -func (repo *MockMigrationFsRepo) Exists(version string) (bool, error) { - repo.ExistsCallCount += 1 - return repo.ExistsReturnValue.Exists, repo.ExistsReturnValue.Err -} - -func (repo *MockMigrationFsRepo) Get(version string) (*models.Migration, error) { - repo.GetCallCount += 1 - return repo.GetReturnValue.Migration, repo.GetReturnValue.Err -} - func (repo *MockMigrationFsRepo) List() (map[string]*models.Migration, error) { repo.ListCallCount += 1 return repo.ListReturnValue.Migrations, repo.ListReturnValue.Err |