@@ -89,7 +89,7 @@ def test_whole_second_time_input(cypher_eval):
89
89
def test_nanosecond_resolution_time_input (cypher_eval ):
90
90
result = cypher_eval ("CYPHER runtime=interpreted WITH $x AS x "
91
91
"RETURN [x.hour, x.minute, x.second, x.nanosecond]" ,
92
- x = Time (12 , 34 , 56. 789012345 ))
92
+ x = Time (12 , 34 , 56 , 789012345 ))
93
93
hour , minute , second , nanosecond = result
94
94
assert hour == 12
95
95
assert minute == 34
@@ -101,7 +101,7 @@ def test_time_with_numeric_time_offset_input(cypher_eval):
101
101
result = cypher_eval ("CYPHER runtime=interpreted WITH $x AS x "
102
102
"RETURN [x.hour, x.minute, x.second, "
103
103
" x.nanosecond, x.offset]" ,
104
- x = Time (12 , 34 , 56. 789012345 , tzinfo = FixedOffset (90 )))
104
+ x = Time (12 , 34 , 56 , 789012345 , tzinfo = FixedOffset (90 )))
105
105
hour , minute , second , nanosecond , offset = result
106
106
assert hour == 12
107
107
assert minute == 34
@@ -150,7 +150,7 @@ def test_nanosecond_resolution_datetime_input(cypher_eval):
150
150
result = cypher_eval ("CYPHER runtime=interpreted WITH $x AS x "
151
151
"RETURN [x.year, x.month, x.day, "
152
152
" x.hour, x.minute, x.second, x.nanosecond]" ,
153
- x = DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 ))
153
+ x = DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 ))
154
154
year , month , day , hour , minute , second , nanosecond = result
155
155
assert year == 1976
156
156
assert month == 6
@@ -166,7 +166,7 @@ def test_datetime_with_numeric_time_offset_input(cypher_eval):
166
166
"RETURN [x.year, x.month, x.day, "
167
167
" x.hour, x.minute, x.second, "
168
168
" x.nanosecond, x.offset]" ,
169
- x = DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 ,
169
+ x = DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 ,
170
170
tzinfo = FixedOffset (90 )))
171
171
year , month , day , hour , minute , second , nanosecond , offset = result
172
172
assert year == 1976
@@ -180,7 +180,7 @@ def test_datetime_with_numeric_time_offset_input(cypher_eval):
180
180
181
181
182
182
def test_datetime_with_named_time_zone_input (cypher_eval ):
183
- dt = DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 )
183
+ dt = DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 )
184
184
input_value = timezone ("US/Pacific" ).localize (dt )
185
185
result = cypher_eval ("CYPHER runtime=interpreted WITH $x AS x "
186
186
"RETURN [x.year, x.month, x.day, "
@@ -199,7 +199,7 @@ def test_datetime_with_named_time_zone_input(cypher_eval):
199
199
200
200
201
201
def test_datetime_array_input (cypher_eval ):
202
- data = [DateTime (2018 , 4 , 6 , 13 , 4 , 42. 516120 ), DateTime (1976 , 6 , 13 )]
202
+ data = [DateTime (2018 , 4 , 6 , 13 , 4 , 42 , 516120 ), DateTime (1976 , 6 , 13 )]
203
203
value = cypher_eval ("CREATE (a {x:$x}) RETURN a.x" , x = data )
204
204
assert value == data
205
205
@@ -209,7 +209,7 @@ def test_duration_input(cypher_eval):
209
209
"RETURN [x.months, x.days, x.seconds, "
210
210
" x.microsecondsOfSecond]" ,
211
211
x = Duration (years = 1 , months = 2 , days = 3 , hours = 4 ,
212
- minutes = 5 , seconds = 6. 789012 ))
212
+ minutes = 5 , seconds = 6 , microseconds = 789012 ))
213
213
months , days , seconds , microseconds = result
214
214
assert months == 14
215
215
assert days == 3
@@ -258,13 +258,13 @@ def test_whole_second_time_output(cypher_eval):
258
258
def test_nanosecond_resolution_time_output (cypher_eval ):
259
259
value = cypher_eval ("RETURN time('12:34:56.789012345')" )
260
260
assert isinstance (value , Time )
261
- assert value == Time (12 , 34 , 56. 789012345 , tzinfo = FixedOffset (0 ))
261
+ assert value == Time (12 , 34 , 56 , 789012345 , tzinfo = FixedOffset (0 ))
262
262
263
263
264
264
def test_time_with_numeric_time_offset_output (cypher_eval ):
265
265
value = cypher_eval ("RETURN time('12:34:56.789012345+0130')" )
266
266
assert isinstance (value , Time )
267
- assert value == Time (12 , 34 , 56. 789012345 , tzinfo = FixedOffset (90 ))
267
+ assert value == Time (12 , 34 , 56 , 789012345 , tzinfo = FixedOffset (90 ))
268
268
269
269
270
270
def test_whole_second_localtime_output (cypher_eval ):
@@ -276,7 +276,7 @@ def test_whole_second_localtime_output(cypher_eval):
276
276
def test_nanosecond_resolution_localtime_output (cypher_eval ):
277
277
value = cypher_eval ("RETURN localtime('12:34:56.789012345')" )
278
278
assert isinstance (value , Time )
279
- assert value == Time (12 , 34 , 56. 789012345 )
279
+ assert value == Time (12 , 34 , 56 , 789012345 )
280
280
281
281
282
282
def test_whole_second_datetime_output (cypher_eval ):
@@ -288,22 +288,22 @@ def test_whole_second_datetime_output(cypher_eval):
288
288
def test_nanosecond_resolution_datetime_output (cypher_eval ):
289
289
value = cypher_eval ("RETURN datetime('1976-06-13T12:34:56.789012345')" )
290
290
assert isinstance (value , DateTime )
291
- assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 , tzinfo = utc )
291
+ assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 , tzinfo = utc )
292
292
293
293
294
294
def test_datetime_with_numeric_time_offset_output (cypher_eval ):
295
295
value = cypher_eval ("RETURN "
296
296
"datetime('1976-06-13T12:34:56.789012345+01:30')" )
297
297
assert isinstance (value , DateTime )
298
- assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 ,
298
+ assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 ,
299
299
tzinfo = FixedOffset (90 ))
300
300
301
301
302
302
def test_datetime_with_named_time_zone_output (cypher_eval ):
303
303
value = cypher_eval ("RETURN datetime('1976-06-13T12:34:56.789012345"
304
304
"[Europe/London]')" )
305
305
assert isinstance (value , DateTime )
306
- dt = DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 )
306
+ dt = DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 )
307
307
assert value == timezone ("Europe/London" ).localize (dt )
308
308
309
309
@@ -317,21 +317,21 @@ def test_nanosecond_resolution_localdatetime_output(cypher_eval):
317
317
value = cypher_eval ("RETURN "
318
318
"localdatetime('1976-06-13T12:34:56.789012345')" )
319
319
assert isinstance (value , DateTime )
320
- assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56. 789012345 )
320
+ assert value == DateTime (1976 , 6 , 13 , 12 , 34 , 56 , 789012345 )
321
321
322
322
323
323
def test_duration_output (cypher_eval ):
324
324
value = cypher_eval ("RETURN duration('P1Y2M3DT4H5M6.789S')" )
325
325
assert isinstance (value , Duration )
326
326
assert value == Duration (years = 1 , months = 2 , days = 3 , hours = 4 ,
327
- minutes = 5 , seconds = 6. 789 )
327
+ minutes = 5 , seconds = 6 , milliseconds = 789 )
328
328
329
329
330
330
def test_nanosecond_resolution_duration_output (cypher_eval ):
331
331
value = cypher_eval ("RETURN duration('P1Y2M3DT4H5M6.789123456S')" )
332
332
assert isinstance (value , Duration )
333
333
assert value == Duration (years = 1 , months = 2 , days = 3 , hours = 4 ,
334
- minutes = 5 , seconds = 6. 789123456 )
334
+ minutes = 5 , seconds = 6 , nanoseconds = 789123456 )
335
335
336
336
337
337
def test_datetime_parameter_case1 (session ):
0 commit comments