示例#1
0
def test_points_from_single_instruction():
    wire = Wire()
    wire._extend_points_from_single_instruction("U2")
    assert wire.points == [(0, 0), (0, 1), (0, 2)]

    wire = Wire()
    with pytest.raises(InvalidInstructionFormat):
        wire._extend_points_from_single_instruction("")
    with pytest.raises(InvalidInstructionFormat):
        wire._extend_points_from_single_instruction("U")
    with pytest.raises(InvalidInstructionFormat):
        wire._extend_points_from_single_instruction("U2D")
    with pytest.raises(InvalidInstructionFormat):
        wire._extend_points_from_single_instruction("U2,")
    with pytest.raises(InvalidInstructionFormat):
        wire._extend_points_from_single_instruction("U2,D2")