def test_load_from_text(): entity = Spline.from_text(SPLINE) assert entity.dxf.layer == "0" assert entity.dxf.color == 256, "default color is 256 (by layer)" assert entity.dxf.extrusion == (0, 0, 1) assert entity.dxf.flags == 0 assert entity.dxf.degree == 3 assert entity.dxf.n_knots == 0 assert entity.dxf.n_control_points == 0 assert entity.dxf.n_fit_points == 0
def test_write_dxf(): entity = Spline.from_text(SPLINE2) result = TagCollector.dxftags(entity) expected = basic_tags_from_text(SPLINE2) assert cmp_tags(result, expected, abs_tol=1e-4) == 0
def test_ignore_invalid_tangent_values_at_loading_stage(): spline = Spline.from_text(SPLINE_INVALID_TANGENT) assert spline.dxf.hasattr("start_tangent") is False assert spline.dxf.hasattr("end_tangent") is False
def spline(): return Spline.from_text(SPLINE)