MCPcopy
hub / github.com/helm/helm / mockGetReleaseCustomLabels

Function mockGetReleaseCustomLabels

pkg/storage/driver/sql_test.go:557–578  ·  view source on GitHub ↗
(mock sqlmock.Sqlmock, key string, namespace string, labels map[string]string)

Source from the content-addressed store, hash-verified

555}
556
557func mockGetReleaseCustomLabels(mock sqlmock.Sqlmock, key string, namespace string, labels map[string]string) {
558 query := fmt.Sprintf(
559 regexp.QuoteMeta("SELECT %s, %s FROM %s WHERE %s = $1 AND %s = $2"),
560 sqlCustomLabelsTableKeyColumn,
561 sqlCustomLabelsTableValueColumn,
562 sqlCustomLabelsTableName,
563 sqlCustomLabelsTableReleaseKeyColumn,
564 sqlCustomLabelsTableReleaseNamespaceColumn,
565 )
566
567 eq := mock.ExpectQuery(query).
568 WithArgs(key, namespace)
569
570 returnRows := mock.NewRows([]string{
571 sqlCustomLabelsTableKeyColumn,
572 sqlCustomLabelsTableValueColumn,
573 })
574 for k, v := range labels {
575 returnRows.AddRow(k, v)
576 }
577 eq.WillReturnRows(returnRows).RowsWillBeClosed()
578}
579
580func TestSqlCheckAppliedMigrations(t *testing.T) {
581 cases := []struct {

Callers 4

TestSQLGetFunction · 0.85
TestSQLListFunction · 0.85
TestSqlQueryFunction · 0.85
TestSqlDeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…