Ejemplo n.º 1
0
 def test_jsonvaluenone(self):
     v = DlTimestamp(None)
     self.assertIsNone(v.jsonvalue)
Ejemplo n.º 2
0
 def test_jsonvalue(self):
     v = DlTimestamp(
         datetime.datetime(
             2020, 9, 17, 14, 3, 12, 456789,
             datetime.timezone(datetime.timedelta(seconds=3600))))
     self.assertEqual(v.jsonvalue, "2020-09-17 14:03:12.456789+0100")
Ejemplo n.º 3
0
 def test_typecode(self):
     v = DlTimestamp(
         datetime.datetime(
             2020, 9, 17, 14, 3, 12, 456789,
             datetime.timezone(datetime.timedelta(seconds=3600))))
     self.assertEqual(v.typecode, "z")
Ejemplo n.º 4
0
 def test_fulltypename(self):
     v = DlTimestamp(
         datetime.datetime(
             2020, 9, 17, 14, 3, 12, 456789,
             datetime.timezone(datetime.timedelta(seconds=3600))))
     self.assertEqual(v.fulltypename, "TIMESTAMP")
Ejemplo n.º 5
0
 DlDictionary({
     "ID":
     DlInteger(1),
     "NAME":
     DlString("Sherlock Holmes"),
     "ADDRESS":
     DlString("221b, Baker Street, London, NW1 6XE, UK", 200),
     "SALARY":
     DlDecimal(Decimal("12.45"), 16, 2),
     "TAXES":
     DlDecimal(
         Decimal("687192025652473624789243787872498713367.89012")),
     "BIRTHDAY":
     DlDate(datetime.date(2020, 1, 3)),
     "VISIT_TS":
     DlTimestamp(datetime.datetime.now()),
     "IS_MARRIED":
     DlBoolean(False),
     "CHILDREN":
     DlList([]),
     "TEMPERATURE":
     DlDictionary({
         "OUTDOOR": DlDouble(2.3),
         "INDOOR": DlDouble(21.8)
     }),
     "COMPLEX":
     DlDictionary({
         "FILENAME": DlString("FILE1.TXT"),
         "FILEBODY": DlRaw("s4pQ")
     }),
     "DEEP":