Skip to content

Commit 706b72d

Browse files
committed
Removed test datatypes softly test
1 parent c1e90ef commit 706b72d

File tree

1 file changed

+0
-70
lines changed

1 file changed

+0
-70
lines changed

tests/nuodb_basic_test.py

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -439,76 +439,6 @@ def test_utf8_string_types(self):
439439
finally:
440440
con.close()
441441

442-
def DISABLE_DB10321test_date_types_softly(self):
443-
'''
444-
Just like ``test_date_types'' only this one uses EscapingTimestamps to
445-
make sure that we're testing the datetime data type, and not the
446-
implicit string conversion involved in it.
447-
'''
448-
con = self._connect()
449-
cursor = con.cursor()
450-
cursor.execute("drop table typetest if exists")
451-
try:
452-
cursor.execute("create table typetest (id integer GENERATED ALWAYS AS IDENTITY, date_col date, " +
453-
"time_col time, timestamp_col_EDT timestamp, timestamp_col_EST timestamp)")
454-
455-
test_daylight = Local.localize(
456-
EscapingTimestamp(2013, 3, 24, 12, 3, 26, 0))
457-
test_standard = Local.localize(
458-
EscapingTimestamp(2013, 11, 8, 23, 47, 32, 0))
459-
test_vals = (
460-
pynuodb.Date(2008, 1, 1),
461-
pynuodb.Time(8, 13, 34),
462-
test_daylight,
463-
test_standard
464-
)
465-
quoted_vals = ["'%s'" % str(val) for val in test_vals]
466-
for i, test_val in enumerate(test_vals):
467-
if "'" in str(test_val):
468-
quoted_vals[i] = str(test_val)
469-
exc_str = ("insert into typetest ("
470-
"date_col, "
471-
"time_col, "
472-
"timestamp_col_EDT, "
473-
"timestamp_col_EST) "
474-
"values (" + ', '.join(quoted_vals) + ")")
475-
cursor.execute(exc_str)
476-
477-
cursor.execute("select * from typetest order by id desc limit 1")
478-
row = list(cursor.fetchone())
479-
row.pop(0)
480-
res_daylight = row[2]
481-
res_standard = row[3]
482-
483-
self.assertEqual(
484-
test_daylight - test_standard,
485-
res_daylight - res_standard)
486-
487-
for res_val, test_val in zip(row, test_vals):
488-
self.assertIsInstance(test_val, type(res_val))
489-
490-
if 'year' in dir(test_val):
491-
self.assertEqual(res_val.year, test_val.year)
492-
if 'month' in dir(test_val):
493-
self.assertEqual(res_val.month, test_val.month)
494-
if 'day' in dir(test_val):
495-
self.assertEqual(res_val.day, test_val.day)
496-
497-
if 'hour' in dir(test_val):
498-
self.assertEqual(res_val.hour, test_val.hour)
499-
if 'minute' in dir(test_val):
500-
self.assertEqual(res_val.minute, test_val.minute)
501-
if 'second' in dir(test_val):
502-
self.assertEqual(res_val.second, test_val.second)
503-
if 'microsecond' in dir(test_val):
504-
self.assertEqual(res_val.microsecond, test_val.microsecond)
505-
506-
finally:
507-
try:
508-
cursor.execute("drop table typetest if exists")
509-
finally:
510-
con.close()
511-
512442
def test_date_types(self):
513443

514444
con = self._connect()

0 commit comments

Comments
 (0)