Exemplo n.º 1
0
    def test_normal_(self, table_name, headers, dup_col_handler, expected):
        new_tabledata = SQLiteTableDataSanitizer(
            TableData(table_name, headers, []), dup_col_handler=dup_col_handler
        ).normalize()

        print_test_result(expected=dump_tabledata(expected), actual=dump_tabledata(new_tabledata))

        assert new_tabledata.equals(expected)
Exemplo n.º 2
0
    def test_normal(self, table_name, headers, records, expected):
        new_tabledata = SQLiteTableDataSanitizer(
            TableData(table_name, headers, records)
        ).normalize()

        print_test_result(expected=dump_tabledata(expected), actual=dump_tabledata(new_tabledata))

        con = connect_memdb()
        con.create_table_from_tabledata(new_tabledata)
        assert con.select_as_tabledata(new_tabledata.table_name) == expected

        assert new_tabledata.equals(expected)
Exemplo n.º 3
0
    def test_normal_(self, table_name, headers, dup_col_handler, expected):
        new_tabledata = SQLiteTableDataSanitizer(
            TableData(table_name, headers, []),
            dup_col_handler=dup_col_handler).normalize()

        try:
            from pytablewriter import dumps_tabledata

            print_test_result(expected=dumps_tabledata(expected),
                              actual=dumps_tabledata(new_tabledata))
        except ImportError:
            pass

        assert new_tabledata.equals(expected)
Exemplo n.º 4
0
    def test_normal(self, table_name, headers, records, expected):
        new_tabledata = SQLiteTableDataSanitizer(
            TableData(table_name, headers, records)).normalize()

        try:
            from pytablewriter import dumps_tabledata

            print_test_result(expected=dumps_tabledata(expected),
                              actual=dumps_tabledata(new_tabledata))
        except ImportError:
            pass

        con = connect_memdb()
        con.create_table_from_tabledata(new_tabledata)
        assert con.select_as_tabledata(new_tabledata.table_name) == expected

        assert new_tabledata.equals(expected)