Skip to content

Commit

Permalink
update tag test
Browse files Browse the repository at this point in the history
  • Loading branch information
berosen committed Jul 13, 2022
1 parent 688ad5d commit 584f011
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions pkg/resources/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,6 @@ func TestTagCreate(t *testing.T) {
})
}

func TestTagUpdate(t *testing.T) {
r := require.New(t)

in := map[string]interface{}{
"name": "good_name",
"database": "test_db",
"schema": "test_schema",
"comment": "great comment",
"allowed_values": []interface{}{"marketing", "finance"},
}

d := tag(t, "test_db|test_schema|good_name", in)
r.NotNil(d)

WithMockDb(t, func(db *sql.DB, mock sqlmock.Sqlmock) {
mock.ExpectExec(`^ALTER TAG "test_db"."test_schema"."good_name" SET COMMENT = 'great comment'$`).WillReturnResult(sqlmock.NewResult(1, 1))
mock.ExpectExec(`^ALTER TAG "test_db"."test_schema"."good_name" UNSET ALLOWED_VALUES$`).WillReturnResult(sqlmock.NewResult(1, 1))
mock.ExpectExec(`^ALTER TAG "test_db"."test_schema"."good_name" ADD ALLOWED_VALUES 'marketing', 'finance'$`).WillReturnResult(sqlmock.NewResult(1, 1))

expectReadTag(mock)
err := resources.UpdateTag(d, db)
r.NoError(err)
})
}

func TestTagDelete(t *testing.T) {
r := require.New(t)
Expand Down

0 comments on commit 584f011

Please sign in to comment.