Ejemplo n.º 1
0
 def test_make_column_string_length(self):
     c = sql.make_column(
         table.Column(
             0, 'test',
             [u'this', u'is', u'test', u'data', u'that', u'is', u'awesome'
              ]))
     self.assertEqual(c.type.length, 7)
Ejemplo n.º 2
0
 def test_make_column_datetime(self):
     c = sql.make_column(
         table.Column(0, 'test', [
             u'Jan 1, 2008 at 4:40 AM', u'2010-01-27T03:45:00',
             u'3/1/08 16:14:45', ''
         ]))
     self.assertEqual(type(c.type), DateTime)
Ejemplo n.º 3
0
 def test_make_column_int(self):
     c = sql.make_column(
         table.Column(0, 'test', ['1', '-87', '418000000', '']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), Integer)
Ejemplo n.º 4
0
 def test_make_column_name(self):
     c = sql.make_column(
         table.Column(0, 'test', ['1', '-87', '418000000', '']))
     self.assertEqual(c.key, 'test')
Ejemplo n.º 5
0
 def test_column_has_nulls(self):
     c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000', u'']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), Integer)
     self.assertEqual(c.nullable, True)
Ejemplo n.º 6
0
 def test_make_column_string(self):
     c = sql.make_column(table.Column(0, 'test', [u'this', u'is', u'test', u'data']))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 7
0
 def test_make_column_time(self):
     c = sql.make_column(table.Column(0, 'test', [u'4:40 AM', u'03:45:00', u'16:14:45', u'']))
     self.assertEqual(type(c.type), Time)
Ejemplo n.º 8
0
 def test_make_column_bool(self):
     c = sql.make_column(table.Column(0, "test", [u"True", u"True", u"False", u""]))
     self.assertEqual(type(c.type), Boolean)
Ejemplo n.º 9
0
 def test_make_column_null(self):
     c = sql.make_column(table.Column(0, "test", [u"", u"", u""]))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 10
0
 def test_make_column_time(self):
     c = sql.make_column(table.Column(0, "test", [u"4:40 AM", u"03:45:00", u"16:14:45", u""]))
     self.assertEqual(type(c.type), Time)
Ejemplo n.º 11
0
 def test_make_column_date(self):
     c = sql.make_column(table.Column(0, "test", [u"Jan 1, 2008", u"2010-01-27", u"3/1/08", u""]))
     self.assertEqual(type(c.type), Date)
Ejemplo n.º 12
0
 def test_make_column_datetime(self):
     c = sql.make_column(
         table.Column(0, "test", [u"Jan 1, 2008 at 4:40 AM", u"2010-01-27T03:45:00", u"3/1/08 16:14:45", u""])
     )
     self.assertEqual(type(c.type), DateTime)
Ejemplo n.º 13
0
 def test_make_column_float(self):
     c = sql.make_column(table.Column(0, "test", [u"1.01", u"-87.34", u"418000000.0", u""]))
     self.assertEqual(type(c.type), Float)
Ejemplo n.º 14
0
 def test_make_column_int(self):
     c = sql.make_column(table.Column(0, "test", [u"1", u"-87", u"418000000", u""]))
     self.assertEqual(c.key, "test")
     self.assertEqual(type(c.type), Integer)
Ejemplo n.º 15
0
 def test_make_column_time(self):
     c = sql.make_column(
         table.Column(0, 'test', ['4:40 AM', '03:45:00', '16:14:45', '']))
     self.assertEqual(type(c.type), Time)
Ejemplo n.º 16
0
 def test_make_column_string(self):
     c = sql.make_column(
         table.Column(0, 'test', ['this', 'is', 'test', 'data']))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 17
0
 def test_make_column_string(self):
     c = sql.make_column(table.Column(0, "test", [u"this", u"is", u"test", u"data"]))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 18
0
 def test_make_column_date(self):
     c = sql.make_column(table.Column(0, 'test', [u'Jan 1, 2008', u'2010-01-27', u'3/1/08', u'']))
     self.assertEqual(type(c.type), Date)
Ejemplo n.º 19
0
 def test_make_column_string_length(self):
     c = sql.make_column(table.Column(0, "test", [u"this", u"is", u"test", u"data", u"that", u"is", u"awesome"]))
     self.assertEqual(c.type.length, 7)
Ejemplo n.º 20
0
 def test_make_column_null(self):
     c = sql.make_column(table.Column(0, 'test', [u'', u'', u'']))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 21
0
 def test_column_no_nulls(self):
     c = sql.make_column(table.Column(0, "test", [u"1", u"-87", u"418000000"]))
     self.assertEqual(c.key, "test")
     self.assertEqual(type(c.type), Integer)
     self.assertEqual(c.nullable, False)
Ejemplo n.º 22
0
 def test_make_column_string_length(self):
     c = sql.make_column(table.Column(0, 'test', [u'this', u'is', u'test', u'data', u'that', u'is', u'awesome']))
     self.assertEqual(c.type.length, 7)
Ejemplo n.º 23
0
 def test_column_nullable(self):
     c = sql.make_column(table.Column(0, 'test', ['1', '-87', '418000000', '']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), Integer)
     self.assertEqual(c.nullable, True)
Ejemplo n.º 24
0
 def test_column_no_nulls(self):
     c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), Integer)
     self.assertEqual(c.nullable, False)
Ejemplo n.º 25
0
 def test_make_column_name(self):
     c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000', u'']))
     self.assertEqual(c.key, 'test')
Ejemplo n.º 26
0
 def test_make_column_bool(self):
     c = sql.make_column(
         table.Column(0, 'test', ['True', 'True', 'False', '']))
     self.assertEqual(type(c.type), Boolean)
Ejemplo n.º 27
0
 def test_make_column_bool(self):
     c = sql.make_column(table.Column(0, 'test', [u'True', u'True', u'False', u'']))
     self.assertEqual(type(c.type), Boolean)
Ejemplo n.º 28
0
 def test_make_column_float(self):
     c = sql.make_column(
         table.Column(0, 'test', ['1.01', '-87.34', '418000000.0', '']))
     self.assertEqual(type(c.type), Float)
Ejemplo n.º 29
0
 def test_make_column_big_int(self):
     c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000', u'2147483648']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), BigInteger)
Ejemplo n.º 30
0
 def test_make_column_date(self):
     c = sql.make_column(
         table.Column(0, 'test',
                      ['Jan 1, 2008', '2010-01-27', '3/1/08', '']))
     self.assertEqual(type(c.type), Date)
Ejemplo n.º 31
0
 def test_make_column_float(self):
     c = sql.make_column(table.Column(0, 'test', [u'1.01', u'-87.34', u'418000000.0', u'']))
     self.assertEqual(type(c.type), Float)
Ejemplo n.º 32
0
 def test_make_column_null(self):
     c = sql.make_column(table.Column(0, 'test', ['', '', '']))
     self.assertEqual(type(c.type), String)
Ejemplo n.º 33
0
 def test_make_column_datetime(self):
     c = sql.make_column(table.Column(0, 'test', [u'Jan 1, 2008 at 4:40 AM', u'2010-01-27T03:45:00', u'3/1/08 16:14:45', u'']))
     self.assertEqual(type(c.type), DateTime)
Ejemplo n.º 34
0
 def test_column_not_nullable(self):
     c = sql.make_column(table.Column(0, 'test', ['1', '-87', '418000000']))
     self.assertEqual(c.key, 'test')
     self.assertEqual(type(c.type), Integer)
     self.assertEqual(c.nullable, False)
Ejemplo n.º 35
0
 def test_make_column_name(self):
     c = sql.make_column(table.Column(0, "test", [u"1", u"-87", u"418000000", u""]))
     self.assertEqual(c.key, "test")