def pop_layer(self): layer = self._layers.pop() elements = layer.to_list_pop() queries = [ layer_factory(e, self._dialect).pop_query(e) for e in elements ] self._run_queries(queries)
def push_layer(self, layer: Layer): self._layers.append(layer) elements = layer.to_list_push() queries = [ layer_factory(e, self._dialect).push_query(e) for e in elements ] self._run_queries(queries)
def test_layer_factory_raises_type_error_on_unknown_element(value): with pytest.raises(TypeError, match="Unable to instantiate Layer Query. .*"): layer_factory(value, None)
def test_layer_factory(element, expected_type): query = layer_factory(element, None) assert isinstance(query, expected_type)