openmeter / streaming /clickhouse /utils_query_test.go
Leon4gr45's picture
Upload folder using huggingface_hub (part 6)
d6f631f verified
Raw
History Blame Contribute Delete
319 Bytes
package clickhouse
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_ValidateJsonPathQuery(t *testing.T) {
query, args := validateJsonPathQuery{
jsonPath: "$.foo.bar",
}.toSQL()
assert.Equal(t, `SELECT JSON_VALUE('{}', ?)`, query)
assert.Equal(t, []interface{}{
"$.foo.bar",
}, args)
}