From 28e3be4dc9cec84788854ff33364533ba9d7fd1f Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Thu, 31 Aug 2023 12:27:28 +0200 Subject: [PATCH] test: more test cases --- influxdb3/client_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/influxdb3/client_test.go b/influxdb3/client_test.go index aa02cc1..07d1eb6 100644 --- a/influxdb3/client_test.go +++ b/influxdb3/client_test.go @@ -246,6 +246,24 @@ func TestNewFromEnv(t *testing.T) { }, }, }, + { + name: "invalid precision", + vars: map[string]string{ + "INFLUX_HOST": "http://host:8086", + "INFLUX_TOKEN": "abc", + "INFLUX_PRECISION": "xs", + }, + err: "unsupported precision", + }, + { + name: "invalid gzip threshold", + vars: map[string]string{ + "INFLUX_HOST": "http://host:8086", + "INFLUX_TOKEN": "abc", + "INFLUX_GZIP_THRESHOLD": "a0", + }, + err: "invalid syntax", + }, } clearEnv := func() { os.Unsetenv(envInfluxHost)