def test_parameters_name_prefix(): assert_that( parameters(name_prefix="key", foo="bar"), contains(has_properties( key="foo", name="key_foo", value="bar", ), ), ),
def test_create_set(): ast = create(node()).set(*parameters(foo="bar")) assert_that( str(ast), is_(equal_to("CREATE () SET foo = $foo")), ) assert_that( dict(ast), is_(equal_to(dict(foo="bar"))), )
def test_set(): ast = set(*parameters(foo="bar")) assert_that( str(ast), is_(equal_to("SET foo = $foo")), ) assert_that( dict(ast), is_(equal_to(dict(foo="bar"))), )
def test_match_set(): ast = match(node()).set(*parameters(foo="bar")) assert_that( str(ast), is_(equal_to("MATCH () SET foo = $foo")), ) assert_that( dict(ast), is_(equal_to(dict(foo="bar"))), )
def test_properties(): ast = properties(parameters(foo="bar", this="that")) assert_that( str(ast), is_(equal_to("{foo: $foo, this: $this}")), ) assert_that( dict(ast), is_(equal_to(dict( foo="bar", this="that", ))), )
def test_parameters(): assert_that( parameters(foo="bar", this="that"), contains( has_properties( key="foo", name="foo", value="bar", ), has_properties( key="this", name="this", value="that", ), ), ),
def test_parameters_empty(): assert_that( parameters(), is_(empty()), ),