예제 #1
0
    def test_location_col_add(self):
        drop_if_exists(self.opera_meta.dataset_name)

        etl = PlenarioETL(self.opera_meta, source_path=self.opera_path)
        new_table = etl.add()

        all_rows = postgres_session.execute(new_table.select()).fetchall()
        self.assertEqual(len(all_rows), 5)
        postgres_session.close()
        new_table.drop(postgres_engine, checkfirst=True)

        # Did we add a bbox?
        bbox = MetaTable.get_by_dataset_name('public_opera_performances').bbox
        self.assertIsNotNone(bbox)
예제 #2
0
    def test_new_table_has_correct_column_names_in_meta(self):
        drop_if_exists(self.unloaded_meta.dataset_name)

        etl = PlenarioETL(self.unloaded_meta, source_path=self.radio_path)
        new_table = etl.add()

        columns = postgres_session.query(MetaTable.column_names)
        columns = columns.filter(MetaTable.dataset_name == self.unloaded_meta.dataset_name)
        columns = columns.first()[0]

        self.assertEqual(len(columns), 4)

        postgres_session.close()
        new_table.drop(postgres_engine, checkfirst=True)
예제 #3
0
    def test_new_table(self):
        drop_if_exists(self.unloaded_meta.dataset_name)

        etl = PlenarioETL(self.unloaded_meta, source_path=self.radio_path)
        new_table = etl.add()

        all_rows = postgres_session.execute(new_table.select()).fetchall()
        self.assertEqual(len(all_rows), 5)
        postgres_session.close()
        new_table.drop(postgres_engine, checkfirst=True)

        # Did we add a bbox?
        bbox = MetaTable.get_by_dataset_name('community_radio_events').bbox
        self.assertIsNotNone(bbox)
예제 #4
0
 def tearDown(self):
     postgres_session.close()
예제 #5
0
 def tearDownClass(cls):
     postgres_session.close()