Пример #1
0
 def setUp(self):
     super(self.__class__, self).setUp()
     self.writer = PostgresDbWriter(self.config.options['destination']['postgres'], True)
Пример #2
0
class TestPostgresDbWriter(WithOutput):
    def setUp(self):
        super(self.__class__, self).setUp()
        self.writer = PostgresDbWriter(self.config.options['destination']['postgres'], True)
    def tearDown(self):
        super(self.__class__, self).tearDown()
        self.writer.close()

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

    def test_write_table_indexes_and_constraints(self):
        self.writer.write_table(table=self.table1)
        self.writer.write_indexes(self.table1)
        self.writer.write_constraints(self.table2)

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