def test_create_database(): settings = SettingsObject(INI_ABSPATH) try: drop_database(settings) except Exception: pass create_database(settings)
def test_perform_checks_with_sql_raise(self): ini_relpath_key_missing = "data/instellingen_test_missing_key.ini" ini_abspath_key_missing = os.path.join(OUR_DIR, ini_relpath_key_missing) test_settings = SettingsObject(ini_abspath_key_missing) with pytest.raises(Exception): self.db.perform_checks_with_sql( self.db, test_settings, "v2_manhole", "completeness" )
def setUpClass(cls): cls.settings = SettingsObject(INI_ABSPATH) try: drop_database(cls.settings) except Exception: pass create_database(cls.settings) cls.db = ThreediDatabase(cls.settings) cls.db.create_extension(extension_name="postgis") cls.db.initialize_db_threedi() cls.db.create_schema("src")
def setUpClass(cls): cls.settings = SettingsObject(INI_ABSPATH) try: drop_database(cls.settings) except Exception: pass create_database(cls.settings) cls.db = ThreediDatabase(cls.settings) cls.db.create_extension(extension_name="postgis") cls.db.initialize_db_threedi() # load GBI manholes only into tester manhole_layer_rel_path = "data/schiedam-test/schiedam-putten-test.shp" cls.settings.manhole_layer = os.path.join(OUR_DIR, manhole_layer_rel_path) cls.settings.import_type = "gbi" import_sewerage_data_into_db(cls.db, cls.settings)
def setUpClass(cls): cls.settings = SettingsObject(INI_ABSPATH) try: drop_database(cls.settings) except Exception: pass create_database(cls.settings) cls.db = ThreediDatabase(cls.settings) cls.db.create_extension(extension_name="postgis") cls.db.initialize_db_threedi() cls.db.create_schema("src") # Create geopackage datasource if os.path.isfile(GKPG_ABSPATH): os.remove(GKPG_ABSPATH) cls.gpkg_source = None cls.gpkg_source = DRIVER_OGR_GPKG.CreateDataSource(GKPG_ABSPATH) cls.gpkg_source = set_ogr_connection(GKPG_ABSPATH)
def setUpClass(cls): cls.settings = SettingsObject(INI_ABSPATH) create_database(cls.settings) cls.db = ThreediDatabase(cls.settings) cls.db.create_extension(extension_name="postgis") cls.db.initialize_db_threedi()
def setUpClass(cls): cls.settings = SettingsObject(INI_ABSPATH) create_database(cls.settings) cls.db = ThreediDatabase(cls.settings)
def test_init_threedidatabase_raise(): settings = SettingsObject(INI_ABSPATH) settings.database = "unkown" with pytest.raises(Exception): ThreediDatabase(settings)
def test_init_threedidatabase(): settings = SettingsObject(INI_ABSPATH) create_database(settings) ThreediDatabase(settings) drop_database(settings)
def test_drop_database(): settings = SettingsObject(INI_ABSPATH) drop_database(settings)
def test_settingsobject_raise(): ini_path = "data/instellingen_test_missing_db.ini" ini_path = os.path.join(OUR_DIR, ini_path) settings = SettingsObject(ini_path) with pytest.raises(Exception): settings.database
def test_settingsobject(): ini_path = "data/instellingen_test.ini" ini_path = os.path.join(OUR_DIR, ini_path) settings = SettingsObject(ini_path) assert settings.__dict__["hoogte_verschil"] == "0.2"