@@ -96,14 +96,8 @@ func TestDateTime(t *testing.T) {
9696 assert .Equal (t , datetime .In (time .UTC ), col1 )
9797 assert .Equal (t , datetime .Unix (), col2 .Unix ())
9898 assert .Equal (t , datetime .Unix (), col3 .Unix ())
99- if protocol == clickhouse .HTTP {
100- // TODO: investigate client_protocol_version HTTP param
101- assert .Equal (t , "UTC" , col2 .Location ().String ())
102- assert .Equal (t , "UTC" , col3 .Location ().String ())
103- } else {
104- assert .Equal (t , "Europe/Moscow" , col2 .Location ().String ())
105- assert .Equal (t , "Europe/London" , col3 .Location ().String ())
106- }
99+ assert .Equal (t , "Europe/Moscow" , col2 .Location ().String ())
100+ assert .Equal (t , "Europe/London" , col3 .Location ().String ())
107101 assert .Equal (t , datetime .Unix (), col4 .Unix ())
108102 require .Len (t , col5 , 2 )
109103 assert .Equal (t , "Europe/Moscow" , col5 [0 ].Location ().String ())
@@ -115,12 +109,7 @@ func TestDateTime(t *testing.T) {
115109 assert .Equal (t , datetime .In (time .UTC ), col7 )
116110 assert .Equal (t , datetime .Unix (), col8 .Unix ())
117111 assert .Equal (t , datetime .Unix (), col9 .Unix ())
118- if protocol == clickhouse .HTTP {
119- // TODO: investigate client_protocol_version HTTP param
120- assert .Equal (t , "UTC" , col8 .Location ().String ())
121- } else {
122- assert .Equal (t , "Asia/Shanghai" , col8 .Location ().String ())
123- }
112+ assert .Equal (t , "Asia/Shanghai" , col8 .Location ().String ())
124113 require .Len (t , col10 , 2 )
125114 assert .Equal (t , "Asia/Shanghai" , col10 [0 ].Location ().String ())
126115 assert .Equal (t , "Asia/Shanghai" , col10 [1 ].Location ().String ())
@@ -224,33 +213,18 @@ func TestNullableDateTime(t *testing.T) {
224213 assert .Equal (t , datetime .In (time .UTC ), col1 )
225214 assert .Equal (t , datetime .Unix (), col1 .Unix ())
226215 require .Nil (t , col2Null )
227- if protocol == clickhouse .HTTP {
228- // TODO: investigate client_protocol_version HTTP param
229- require .Equal (t , "UTC" , col2 .Location ().String ())
230- } else {
231- require .Equal (t , "Europe/Moscow" , col2 .Location ().String ())
232- }
216+ require .Equal (t , "Europe/Moscow" , col2 .Location ().String ())
233217 assert .Equal (t , datetime .Unix (), col2 .Unix ())
234218 assert .Equal (t , datetime .Unix (), col2 .Unix ())
235219 require .Nil (t , col3Null )
236- if protocol == clickhouse .HTTP {
237- // TODO: investigate client_protocol_version HTTP param
238- require .Equal (t , "UTC" , col3 .Location ().String ())
239- } else {
240- require .Equal (t , "Europe/London" , col3 .Location ().String ())
241- }
220+ require .Equal (t , "Europe/London" , col3 .Location ().String ())
242221 assert .Equal (t , datetime .Unix (), col3 .Unix ())
243222 assert .Equal (t , datetime .Unix (), col3 .Unix ())
244223 require .Nil (t , col4Null )
245224 assert .Equal (t , datetime .In (time .UTC ), col4 )
246225 assert .Equal (t , datetime .Unix (), col4 .Unix ())
247226 require .Nil (t , col5Null )
248- if protocol == clickhouse .HTTP {
249- // TODO: investigate client_protocol_version HTTP param
250- require .Equal (t , "UTC" , col5 .Location ().String ())
251- } else {
252- require .Equal (t , "Asia/Shanghai" , col5 .Location ().String ())
253- }
227+ require .Equal (t , "Asia/Shanghai" , col5 .Location ().String ())
254228 assert .Equal (t , datetime .Unix (), col5 .Unix ())
255229 assert .Equal (t , datetime .Unix (), col5 .Unix ())
256230 }
@@ -454,12 +428,7 @@ func TestDateTimeTZ(t *testing.T) {
454428 assert .Equal (t , col8Expected .UTC (), col8 )
455429 col9Expected , err := time .ParseInLocation ("2006-01-02 15:04:05" , "2022-07-20 17:42:48" , time .Local )
456430 require .NoError (t , err )
457- if protocol == clickhouse .HTTP {
458- // TODO: investigate client_protocol_version HTTP param
459- assert .Equal (t , col9Expected .UTC (), col9 )
460- } else {
461- assert .Equal (t , col9Expected .In (asiaLoc ), col9 )
462- }
431+ assert .Equal (t , col9Expected .In (asiaLoc ), col9 )
463432 // datetime - with tz
464433 col10Expected , err := time .ParseInLocation ("2006-01-02 15:04:05" , "2022-07-20 17:42:48" , asiaLoc )
465434 require .NoError (t , err )
@@ -469,12 +438,7 @@ func TestDateTimeTZ(t *testing.T) {
469438 assert .Equal (t , col11Expected .UTC (), col11 )
470439 col12Expected , err := time .ParseInLocation ("2006-01-02 15:04:05" , "2022-07-20 17:42:48" , asiaLoc )
471440 require .NoError (t , err )
472- if protocol == clickhouse .HTTP {
473- // TODO: investigate client_protocol_version HTTP param
474- assert .Equal (t , col12Expected .UTC (), col12 )
475- } else {
476- assert .Equal (t , col12Expected .In (asiaLoc ), col12 )
477- }
441+ assert .Equal (t , col12Expected .In (asiaLoc ), col12 )
478442 })
479443}
480444
0 commit comments