Пример #1
0
def test_create_union():
    ast = create(node()).union_all(create(node()))
    assert_that(
        str(ast),
        is_(equal_to("CREATE () UNION ALL CREATE ()")),
    )
    assert_that(
        dict(ast),
        is_(equal_to(dict())),
    )
Пример #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"))),
    )
Пример #3
0
def test_create_ret():
    ast = create(node()).ret("foo")
    assert_that(
        str(ast),
        is_(equal_to("CREATE () RETURN foo")),
    )
    assert_that(
        dict(ast),
        is_(equal_to(dict())),
    )
Пример #4
0
def test_create_merge():
    ast = create(node()).merge(node())
    assert_that(
        str(ast),
        is_(equal_to("CREATE () MERGE ()")),
    )
    assert_that(
        dict(ast),
        is_(equal_to(dict())),
    )
Пример #5
0
def test_create_match():
    ast = create(node()).match(node())
    assert_that(
        str(ast),
        is_(equal_to("MATCH () CREATE ()")),
    )
    assert_that(
        dict(ast),
        is_(equal_to(dict())),
    )
Пример #6
0
def test_create_delete():
    ast = create(node()).delete("foo")
    assert_that(
        str(ast),
        is_(equal_to("CREATE () DELETE foo")),
    )
    assert_that(
        dict(ast),
        is_(equal_to(dict())),
    )