Exemplo n.º 1
0
 def setUp(self):
     super(self.__class__, self).setUp()
     self.outfile = tempfile.NamedTemporaryFile()
     self.writer = PostgresFileWriter(self.outfile)
Exemplo n.º 2
0
class TestPostgresFileWriter(WithOutput):
    def setUp(self):
        super(self.__class__, self).setUp()
        self.outfile = tempfile.NamedTemporaryFile()
        self.writer = PostgresFileWriter(self.outfile)

    def tearDown(self):
        super(self.__class__, self).tearDown()
        self.writer.close()

    def test_truncate(self):
        self.writer.truncate(self.table1)

    def test_write_table(self):
        self.writer.write_table(self.table1)

    def test_write_indexes(self):
        self.writer.write_indexes(self.table1)

    def test_write_constraints(self):
        self.writer.write_constraints(self.table2)

    def test_write_contents(self):
        self.writer.write_contents(self.table1, self.reader)