Skip to content

Commit

Permalink
fix: Column name fix
Browse files Browse the repository at this point in the history
pigri committed Sep 21, 2024

Verified

This commit was signed with the committer’s verified signature.
pigri David Papp
1 parent 0cc1b29 commit 47c803e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server_test.go
Original file line number Diff line number Diff line change
@@ -112,14 +112,14 @@ func TestChatCompletion(t *testing.T) {

// Mock the database operations for input audit log
mock.ExpectBegin()
mock.ExpectQuery(regexp.QuoteMeta(`INSERT INTO "audit_logs" ("request_id","deleted_at","api_key_id","ip_address","message","message_type","type","metadata","created_at","updated_at","project_id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING "id","created_at","updated_at"`)).
mock.ExpectQuery(regexp.QuoteMeta(`INSERT INTO "audit_logs" ("request_id","deleted_at","api_key_id","ip_address","message","message_type","type","metadata","created_at","updated_at","product_id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING "id","created_at","updated_at"`)).
WithArgs(sqlmock.AnyArg(), nil, sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg(), "input", "openai_chat_completion", sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg()).
WillReturnRows(sqlmock.NewRows([]string{"id", "created_at", "updated_at"}).AddRow(uuid.New(), time.Now(), time.Now()))
mock.ExpectCommit()

// Mock the database operations for output audit log
mock.ExpectBegin()
mock.ExpectQuery(regexp.QuoteMeta(`INSERT INTO "audit_logs" ("request_id","deleted_at","api_key_id","ip_address","message","message_type","type","metadata","created_at","updated_at","project_id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING "id","created_at","updated_at"`)).
mock.ExpectQuery(regexp.QuoteMeta(`INSERT INTO "audit_logs" ("request_id","deleted_at","api_key_id","ip_address","message","message_type","type","metadata","created_at","updated_at","product_id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING "id","created_at","updated_at"`)).
WithArgs(sqlmock.AnyArg(), nil, sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg(), "output", "openai_chat_completion", sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg()).
WillReturnRows(sqlmock.NewRows([]string{"id", "created_at", "updated_at"}).AddRow(uuid.New(), time.Now(), time.Now()))
mock.ExpectCommit()

0 comments on commit 47c803e

Please sign in to comment.