Beispiel #1
0
def test_parameters_name_prefix():
    assert_that(
        parameters(name_prefix="key", foo="bar"),
        contains(has_properties(
            key="foo",
            name="key_foo",
            value="bar",
        ), ),
    ),
Beispiel #2
0
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"))),
    )
Beispiel #3
0
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"))),
    )
Beispiel #4
0
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"))),
    )
Beispiel #5
0
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",
        ))),
    )
Beispiel #6
0
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",
            ),
        ),
    ),
Beispiel #7
0
def test_parameters_empty():
    assert_that(
        parameters(),
        is_(empty()),
    ),