def test_simple_layer_override_vis_url(visserver): visserver.ingest.return_value = "http://bogus_url.com" sl = layers.SimpleLayer("dl", None, RDMock(name="test_data.tif"), vis_url="http://some_other_url.com") assert sl.vis_url == "http://some_other_url.com" assert visserver.ingest.call_count == 0
def test_simple_layer(visserver): data = RDMock(name='test_data.tif') visserver.ingest.return_value = 'http://bogus_url.com' sl = layers.SimpleLayer('sl', None, data) assert sl.data == data assert sl.vis_url == 'http://bogus_url.com' assert visserver.ingest.call_count == 1
def test_layer_reprs(visserver): assert str(layers.GeonotebookLayer('gnbl', None, None)) == \ "<GeonotebookLayer('gnbl')>" assert str(layers.AnnotationLayer('al', None, None)) == \ "<AnnotationLayer('al')>" assert str(layers.NoDataLayer('ndl', None, None)) == "<NoDataLayer('ndl')>" assert str(layers.DataLayer('dl', None, None, vis_url='bogus')) == \ "<DataLayer('dl')>" assert str(layers.SimpleLayer('sl', None, None, vis_url='bogus')) == \ "<SimpleLayer('sl')>" assert str( layers.TimeSeriesLayer('tsl', None, [RDMock(name='bogus_data')]) ) == \ "<TimeSeriesLayer('tsl')>"
def test_simple_layer_with_no_data_and_no_vis_url(visserver): with pytest.raises(AssertionError): layers.SimpleLayer("dl", None, None, vis_url=None)