Exemplo n.º 1
0
Arquivo: test.py Projeto: jthomm/mold
 def test_insert_into_table_sql(self):
     configs = [{'source': 'First',},
                {'source': 'Last', 'type': 'unicode',},
                {'source': 'Age', 'type': 'int',},
                {'source': 'Amt', 'target': 'amount', 'type': 'float',},]
     sqlite_row = SQLiteRow(RowMold(configs))
     self.assertEqual(
         sqlite_row.insert_into_table_sql('test'),
         'INSERT INTO test (first, last, age, amount) VALUES (?, ?, ?, ?)')
Exemplo n.º 2
0
Arquivo: test.py Projeto: jthomm/mold
 def test_create_table_sql(self):
     configs = [{'source': 'First',},
                {'source': 'Last', 'type': 'unicode',},
                {'source': 'Age', 'type': 'int',},
                {'source': 'Amt', 'target': 'amount', 'type': 'float',},]
     sqlite_row = SQLiteRow(RowMold(configs))
     self.assertEqual(
         sqlite_row.create_table_sql('test'),
         'CREATE TABLE test (first TEXT, last TEXT, age INTEGER, amount REAL)')