MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestGetReconciliation_NotFound

Function TestGetReconciliation_NotFound

database/reconciliation_test.go:148–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

146}
147
148func TestGetReconciliation_NotFound(t *testing.T) {
149 db, mock, err := sqlmock.New()
150 assert.NoError(t, err)
151 defer func() { _ = db.Close() }()
152
153 ds := Datasource{Conn: db}
154 ctx := context.TODO()
155
156 mock.ExpectQuery("SELECT id, reconciliation_id, upload_id, status").
157 WithArgs("rec123").
158 WillReturnError(sql.ErrNoRows)
159
160 _, err = ds.GetReconciliation(ctx, "rec123")
161 assert.Error(t, err)
162 assert.Equal(t, apierror.ErrNotFound, err.(apierror.APIError).Code)
163}
164
165func TestUpdateReconciliationStatus_Success(t *testing.T) {
166 db, mock, err := sqlmock.New()

Callers

nothing calls this directly

Calls 3

GetReconciliationMethod · 0.95
CloseMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected