Skip to content

Commit ac27ecf

Browse files
feat: support gzip_threshold
1 parent 047fce5 commit ac27ecf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_influxdb_client_3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def verify_client_write_options(c):
104104

105105
@patch.dict('os.environ', {'INFLUX_HOST': 'localhost', 'INFLUX_TOKEN': 'test_token',
106106
'INFLUX_DATABASE': 'test_db', 'INFLUX_ORG': 'test_org',
107-
'INFLUX_PRECISION': WritePrecision.MS, 'INFLUX_AUTH_SCHEME': 'custom_scheme'})
107+
'INFLUX_PRECISION': WritePrecision.MS, 'INFLUX_AUTH_SCHEME': 'custom_scheme',
108+
'INFLUX_GZIP_THRESHOLD': '2000'})
108109
def test_from_env_all_env_vars_set(self):
109110
client = InfluxDBClient3.from_env()
110111
self.assertIsInstance(client, InfluxDBClient3)
@@ -113,6 +114,7 @@ def test_from_env_all_env_vars_set(self):
113114
self.assertEqual(client._client.auth_header_value, f"custom_scheme {client._token}")
114115
self.assertEqual(client._database, "test_db")
115116
self.assertEqual(client._org, "test_org")
117+
self.assertEqual(client._client.api_client.rest_client.configuration.gzip_threshold, 2000)
116118

117119
write_options = client._write_client_options.get("write_options")
118120
self.assertEqual(write_options.write_precision, WritePrecision.MS)

0 commit comments

Comments
 (0)