Skip to content

Commit

Permalink
Make modifications to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Nov 6, 2023
1 parent 8baf14e commit 162795a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
20 changes: 2 additions & 18 deletions core/models/catalog_products_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func TestCatalogProducts(t *testing.T) {
_, err := db.Exec(`INSERT INTO public.wpp_products_catalog
(uuid, facebook_catalog_id, "name", created_on, modified_on, is_active, channel_id, org_id)
VALUES('2be9092a-1c97-4b24-906f-f0fbe3e1e93e', '123456789', 'Catalog Dummy', now(), now(), true, $1, $2);
`, testdata.TwilioChannel.ID, testdata.Org2.ID)
`, testdata.Org2Channel.ID, testdata.Org2.ID)
assert.NoError(t, err)

ctp, err := models.GetActiveCatalogFromChannel(ctx, *db, testdata.TwilioChannel.ID)
ctp, err := models.GetActiveCatalogFromChannel(ctx, *db, testdata.Org2Channel.ID)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -59,19 +59,3 @@ func TestChannelUUIDForChannelID(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, ctp, testdata.Org2Channel.UUID)
}

// const (
// catalogProductDDL = `
// CREATE TABLE public.wpp_products_catalog (
// id serial4 NOT NULL,
// uuid uuid NOT NULL,
// facebook_catalog_id varchar(30) NOT NULL,
// "name" varchar(100) NOT NULL,
// created_on timestamptz NOT NULL,
// modified_on timestamptz NOT NULL,
// is_active bool NOT NULL,
// channel_id int4 NOT NULL,
// org_id int4 NOT NULL
// );
// `
// )
Binary file modified mailroom_test.dump
Binary file not shown.
4 changes: 2 additions & 2 deletions services/external/weni/wenigpt/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestWeniGPTRequest(t *testing.T) {
"id": "66b6a02c-b6e5-4e94-be8b-c631875b24d1",
"status": "COMPLETED",
"output": {
"text": "weni gpt response output text"
"text": ["banana"]
}
}`),
},
Expand All @@ -76,5 +76,5 @@ func TestWeniGPTRequest(t *testing.T) {

wmsg, _, err := client.WeniGPTRequest(data)
assert.NoError(t, err)
assert.Equal(t, "weni gpt response output text", wmsg.Output.Text[0])
assert.Equal(t, "banana", wmsg.Output.Text[0])
}

0 comments on commit 162795a

Please sign in to comment.