|
15 | 15 | from tarantool.msgpack_ext.unpacker import ext_hook as unpacker_ext_hook
|
16 | 16 |
|
17 | 17 | from .lib.tarantool_server import TarantoolServer
|
18 |
| -from .lib.skip import skip_or_run_datetime_test |
| 18 | +from .lib.skip import skip_or_run_datetime_test, skip_or_run_datetime_2_11_test |
19 | 19 |
|
20 | 20 |
|
21 | 21 | class TestSuiteDatetime(unittest.TestCase):
|
@@ -381,21 +381,23 @@ def test_tarantool_datetime_subtraction(self):
|
381 | 381 | datetime_subtraction_different_timezones_case = {
|
382 | 382 | 'arg_1': tarantool.Datetime(year=2001, month=2, day=3, tz='UTC'),
|
383 | 383 | 'arg_2': tarantool.Datetime(year=2001, month=2, day=3, tz='MSK'),
|
384 |
| - 'res': tarantool.Interval(day=1, hour=-21), |
| 384 | + # Tarantool datetime comparison is naive, our tarantool.Interval comparison is naive too. |
| 385 | + # So even though day=1, hour=-21 is the same as minute=180, test assertion fails. |
| 386 | + 'res_python': tarantool.Interval(day=1, hour=-21), |
| 387 | + 'res_tarantool': tarantool.Interval(minute=180), |
385 | 388 | }
|
386 | 389 |
|
387 | 390 | def test_python_datetime_subtraction_different_timezones(self):
|
388 | 391 | case = self.datetime_subtraction_different_timezones_case
|
389 | 392 |
|
390 |
| - self.assertEqual(case['arg_1'] - case['arg_2'], case['res']) |
| 393 | + self.assertEqual(case['arg_1'] - case['arg_2'], case['res_python']) |
391 | 394 |
|
392 |
| - @skip_or_run_datetime_test |
393 |
| - @unittest.skip('See https://github.com/tarantool/tarantool/issues/7698') |
| 395 | + @skip_or_run_datetime_2_11_test |
394 | 396 | def test_tarantool_datetime_subtraction_different_timezones(self):
|
395 | 397 | case = self.datetime_subtraction_different_timezones_case
|
396 | 398 |
|
397 | 399 | self.assertSequenceEqual(self.con.call('sub', case['arg_1'], case['arg_2']),
|
398 |
| - [case['res']]) |
| 400 | + [case['res_tarantool']]) |
399 | 401 |
|
400 | 402 | interval_arithmetic_cases = {
|
401 | 403 | 'year': {
|
@@ -515,8 +517,7 @@ def test_python_datetime_addition_winter_time_switch(self):
|
515 | 517 |
|
516 | 518 | self.assertEqual(case['arg_1'] + case['arg_2'], case['res'])
|
517 | 519 |
|
518 |
| - @skip_or_run_datetime_test |
519 |
| - @unittest.skip('See https://github.com/tarantool/tarantool/issues/7700') |
| 520 | + @skip_or_run_datetime_2_11_test |
520 | 521 | def test_tarantool_datetime_addition_winter_time_switch(self):
|
521 | 522 | case = self.datetime_addition_winter_time_switch_case
|
522 | 523 |
|
|
0 commit comments