def test_property_width(self): self.validate_node(self.parse_properties, "width: 20", AST.WidthNode(20)) self.validate_node(self.parse_properties, "width: 30", AST.WidthNode(30)) self.check_parse_exception(self.parse_properties, "width: 20.0", pp.ParseException)
def test_default_with_props(self): default = """ default boolean { width: 400 widget checkbox } """ default_node = AST.DefaultWithPropsNode( AST.BoolTypeNode(), BlockNode([AST.WidthNode(400)]), AST.CheckboxNode()) self.validate_node(self.parse_default, default, default_node) default = """ default boolean { width: 400 widget checkbox font: "Arial" } """ self.check_parse_exception(self.parse_default, default, pp.ParseException)