def test_colliding_mux_values():
    f = io.BytesIO(textwrap.dedent('            FormatVersion=5.0 // Do not edit this line!\n            Title="a file"\n\n            {SEND}\n\n            [MuxedId]\n            ID=0h\n            Mux=TheMux 0,1 0h\n            Var=Signal unsigned 1,1\n\n            [MuxedId]\n            Mux=FirstMux 0,1 1h\n            Var=Signal unsigned 1,1\n\n            [MuxedId]\n            Mux=SecondMux 0,1 1h\n            Var=Signal unsigned 1,1\n            ').encode('utf-8'))
    matrix = canmatrix.formats.sym.load(f)
    (error,) = matrix.load_errors
    line_number = 16
    assert (len(matrix.load_errors) == 1)
    assert isinstance(error, canmatrix.formats.sym.DuplicateMuxIdError)
    assert (error.line_number == line_number)
    error_string = str(error)
    assert error_string.startswith('line {line_number}: '.format(line_number=line_number))
    assert ('FirstMux' in error_string)
    assert ('SecondMux' in error_string)
def test_colliding_mux_values():
    f = io.BytesIO(textwrap.dedent('            FormatVersion=5.0 // Do not edit this line!\n            Title="a file"\n\n            {SEND}\n\n            [MuxedId]\n            ID=0h\n            Mux=TheMux 0,1 0h\n            Var=Signal unsigned 1,1\n\n            [MuxedId]\n            Mux=FirstMux 0,1 1h\n            Var=Signal unsigned 1,1\n\n            [MuxedId]\n            Mux=SecondMux 0,1 1h\n            Var=Signal unsigned 1,1\n            ').encode('utf-8'))
    matrix = canmatrix.formats.sym.load(f)
    (error,) = matrix.load_errors
    line_number = 16
    assert (len(matrix.load_errors) == 1)
    assert isinstance(error, canmatrix.formats.sym.DuplicateMuxIdError)
    assert (error.line_number == line_number)
    error_string = str(error)
    assert error_string.startswith('line {line_number}: '.format(line_number=line_number))
    assert ('FirstMux' in error_string)
    assert ('SecondMux' in error_string)