Esempio n. 1
0
    def test_queries_empty(self):
        df0 = Table(cols, [], 'Empty')
        q_create = df0.to_sql_create()
        q_values = df0.to_sql_values()

        df2 = Table.from_sql_create(q_create)
        df2.add_sql_values(q_values)

        self.assertEqual(df2.columns, cols)
        self.assertEqual(df2.rowcnt, 0)
Esempio n. 2
0
    def test_queries(self):
        q_create = df1.to_sql_create()
        q_values = df1.to_sql_values()

        df2 = Table.from_sql_create(q_create)
        df2.add_sql_values(q_values)

        self.assertEqual(df2.columns, df1.columns)
        self.assertEqual(df2.rowcnt, df1.rowcnt)
        self.assertEqual(df2['size'].sum(), df1['size'].sum())
        self.assertEqual(df2['weight'].sum(), df1['weight'].sum())