Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
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)
Пример #4
0
def test_layer_factory(element, expected_type):
    query = layer_factory(element, None)
    assert isinstance(query, expected_type)