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
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
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