def test_from_string_part_placement(self):
        s = """%,Head,Stack,X,Y,R,H,skip,Ref,Comment,
1,1,1,4,22,-45,1,0,LED7,-LED-805
2,2,1,4,19,-45,1,0,LED8,-LED-805
3,1,1,4,16,-45,1,0,LED9,-LED-805"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
    def test_from_string_only_comments(self):
        s = """%This is the first comment.
%This is the second comment."""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(2, len(p.instructions))
        self.assertEqual("This is the first comment.",
                         p.instructions[0].comment)
        self.assertEqual("This is the second comment.",
                         p.instructions[1].comment)
    def test_from_string_stack_offset_no_comment(self):
        s = """%,StackOffsetCommand,Stack,X,Y,Comment
65535,1,0,0,0
65535,1,1,-0.04,-0.1"""

        normalized = """%,StackOffsetCommand,Stack,X,Y,Comment
65535,1,0,0,0,
65535,1,1,-0.04,-0.1,"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(normalized, p.to_csv())
    def test_from_string_panelized_boards(self):
        s = """%,JointedBoardCommand,X,Y
65535,3,1,0,0,0,0,0,"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
    def test_from_string_feed_spacing(self):
        s = """%,FeedSpacingCommand,Stack,FeedSpacing,
65535,2,0,18,
65535,2,1,4,"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
    def test_from_string_stack_offset(self):
        s = """%,StackOffsetCommand,Stack,X,Y,Comment
65535,1,0,0,0,
65535,1,1,-0.04,-0.1,0603"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
    def test_from_string_blank_line(self):
        s = """
"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
    def test_from_string_origin_offset(self):
        s = """%,OriginOffsetCommand,X,Y,,
65535,0,0,0,,"""
        p = PlacementInstructions.from_string(s)
        self.assertEqual(s, p.to_csv())
 def test_add_to_string(self):
     with self.assertRaises(NotImplementedError):
         pi = PlacementInstructions.from_string("655535,69,69,69,69")