@@ -45,7 +45,7 @@ def test_write_with_write_options(self, httpserver: HTTPServer):
4545 write_precision = WritePrecision .US ,
4646 no_sync = False
4747 )
48- )
48+ ),
4949 ).write (self .SAMPLE_RECORD )
5050
5151 self .assert_request_made (httpserver , RequestMatcher (
@@ -87,3 +87,43 @@ def test_write_with_no_sync_true_on_v2_server(self, httpserver: HTTPServer):
8787 self .assert_request_made (httpserver , RequestMatcher (
8888 method = "POST" , uri = "/api/v3/write_lp" ,
8989 query_string = {"org" : "ORG" , "db" : "DB" , "precision" : "nanosecond" , "no_sync" : "true" }))
90+
91+ def test_write_with_no_sync_false_and_gzip (self , httpserver : HTTPServer ):
92+ self .set_response_status (httpserver , 200 )
93+
94+ InfluxDBClient3 (
95+ host = (httpserver .url_for ("/" )), org = "ORG" , database = "DB" , token = "TOKEN" ,
96+ write_client_options = write_client_options (
97+ write_options = WriteOptions (
98+ write_type = WriteType .synchronous ,
99+ write_precision = WritePrecision .US ,
100+ no_sync = False
101+ )
102+ ),
103+ enable_gzip = True
104+ ).write (self .SAMPLE_RECORD )
105+
106+ self .assert_request_made (httpserver , RequestMatcher (
107+ method = "POST" , uri = "/api/v2/write" ,
108+ query_string = {"org" : "ORG" , "bucket" : "DB" , "precision" : "us" },
109+ headers = {"Content-Encoding" : "gzip" }, ))
110+
111+ def test_write_with_no_sync_true_and_gzip (self , httpserver : HTTPServer ):
112+ self .set_response_status (httpserver , 200 )
113+
114+ InfluxDBClient3 (
115+ host = (httpserver .url_for ("/" )), org = "ORG" , database = "DB" , token = "TOKEN" ,
116+ write_client_options = write_client_options (
117+ write_options = WriteOptions (
118+ write_type = WriteType .synchronous ,
119+ write_precision = WritePrecision .US ,
120+ no_sync = True
121+ )
122+ ),
123+ enable_gzip = True
124+ ).write (self .SAMPLE_RECORD )
125+
126+ self .assert_request_made (httpserver , RequestMatcher (
127+ method = "POST" , uri = "/api/v3/write_lp" ,
128+ query_string = {"org" : "ORG" , "db" : "DB" , "precision" : "microsecond" , "no_sync" : "true" },
129+ headers = {"Content-Encoding" : "gzip" }, ))
0 commit comments