def test_line_type_parser_shape(): # A,.25,-.1,[BOX,ltypeshp.shx,x=-.1,s=.1],-.1,1 replacing BOX by shape index 132 ltype = 'A,.25,-.1,[132,ltypeshp.shx,x=-.1,s=.1],-.1,1' result = lin_parser(ltype) assert result == [ 'A', .25, -.1, ['SHAPE', 132, 'ltypeshp.shx', 'x', -.1, 's', .1], -.1, 1 ]
def test_line_type_parser_strings(): ltype = 'A,.5,-.2,["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05],-.25' result = lin_parser(ltype) assert result == [ 'A', .5, -.2, ['TEXT', 'GAS', 'STANDARD', 's', .1, 'u', 0.0, 'x', -0.1, 'y', -.05], -.25 ]
def test_line_type_parser_strings(): ltype = 'A,.5,-.2,["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05],-.25' result = lin_parser(ltype) assert result == [ "A", 0.5, -0.2, ["TEXT", "GAS", "STANDARD", "s", 0.1, "u", 0.0, "x", -0.1, "y", -0.05], -0.25, ]
def test_line_type_parser_shape(): # A,.25,-.1,[BOX,ltypeshp.shx,x=-.1,s=.1],-.1,1 replacing BOX by shape index 132 ltype = "A,.25,-.1,[132,ltypeshp.shx,x=-.1,s=.1],-.1,1" result = lin_parser(ltype) assert result == [ "A", 0.25, -0.1, ["SHAPE", 132, "ltypeshp.shx", "x", -0.1, "s", 0.1], -0.1, 1, ]
def test_line_type_parser_just_numbers(): ltype = 'A,.25,-.125,.25,-.125,0,-.125' result = lin_parser(ltype) assert result == ['A', .25, -.125, .25, -.125, 0, -.125]
def test_line_type_parser_just_numbers(): ltype = "A,.25,-.125,.25,-.125,0,-.125" result = lin_parser(ltype) assert result == ["A", 0.25, -0.125, 0.25, -0.125, 0, -0.125]