def test_write_table(self):
        write_table_cmds = self.writer.write_table(self.table1)
        assert len(write_table_cmds) == 2
        table_cmds, seq_cmds = write_table_cmds
        assert len(table_cmds) == 2
        assert squeeze(table_cmds[0]) == 'DROP TABLE IF EXISTS "%s" CASCADE;' % self.table1.name
        assert 'CREATE TABLE "%s"' % self.table1.name in table_cmds[1]
#        assert self.assertRegexpMatches(squeeze(table_cmds[1]),
#                                        '^CREATE TABLE "%s" \(.*\) WITHOUT OIDS;$' % self.table1.name)

        if seq_cmds:
            assert len(seq_cmds) == 3
            self.assertRegexpMatches(squeeze(seq_cmds[0]),
                                     '^DROP SEQUENCE IF EXISTS %s_([^\s]+)_seq CASCADE;$' % self.table1.name)
            self.assertRegexpMatches(squeeze(seq_cmds[1]),
                                     '^CREATE SEQUENCE %s_([^\s]+)_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;$' % self.table1.name)
            self.assertRegexpMatches(squeeze(seq_cmds[2]),
                                     "^SELECT pg_catalog.setval\('%s_([^\s]+)_seq', \d+, true\);$" % self.table1.name)
dataset/ETHPy150Open philipsoutham/py-mysql2pgsql/tests/test_writer.py/TestPostgresWriter.test_write_table/original