def test_ogc_layer_with_wms_use_layer_ids(self, server_iface, DBSession, test_data): # noqa: ignore=N803 dbsession = DBSession() ogcserver_accesscontrol = OGCServerAccessControl( server_iface, "qgisserver1", "no_project", 21781, lambda: dbsession ) layer = test_data["project"].mapLayersByName("private_layer1")[0] assert layer.id() == ogcserver_accesscontrol.ogc_layer_name(layer)
def test_ogc_layer_name(self, server_iface, dbsession): ogcserver_accesscontrol = OGCServerAccessControl( server_iface, "qgisserver1", 21781, dbsession) for layer_name, expected in (("private_layer1", "private_layer1"), ("private_layer3", "pl3")): layer = QgsProject.instance().mapLayersByName(layer_name)[0] assert expected == ogcserver_accesscontrol.ogc_layer_name(layer)
def test_ogc_layer_with_wms_use_layer_ids(self, server_iface, dbsession): ogcserver_accesscontrol = OGCServerAccessControl( server_iface, 'qgisserver1', 21781, dbsession ) layer = QgsProject.instance().mapLayersByName('private_layer1')[0] assert layer.id() == ogcserver_accesscontrol.ogc_layer_name(layer)
def test_ogc_layer_name(self, server_iface, DBSession, test_data): # noqa: ignore=N803 dbsession = DBSession() ogcserver_accesscontrol = OGCServerAccessControl( server_iface, "qgisserver1", "no_project", 21781, lambda: dbsession ) for layer_name, expected in ( ("private_layer1", "private_layer1"), ("private_layer3", "pl3"), ): layer = test_data["project"].mapLayersByName(layer_name)[0] assert expected == ogcserver_accesscontrol.ogc_layer_name(layer)