Exemplo n.º 1
0
def test_block_properties():
    block = Block(
        Comment("comment", False, False),
        Block(String("hello"), String("There!")),
    )
    block.append(Property(["foo", "bar"], Expression()))
    assert block.has_properties() is True
    assert block.has_media() is False
Exemplo n.º 2
0
def test_block_media():
    block = Block(
        Comment("comment", False, False),
        Block(String("hello"), String("There!")),
    )
    block.append(Media("fizz"))
    assert block.has_properties() is False
    assert block.has_media() is True
Exemplo n.º 3
0
def test_block_append():
    block = Block(
        Comment("comment", False, False),
        Block(String("hello"), String("There!")),
    )
    block.append(Literal("Literal"))
    block.append(true)
    assert block.nodes == [Literal("Literal"), true]
    assert block.has_properties() is False
    assert block.has_media() is False
    assert block.is_empty() is False