def METHOD_NAME(self):
    """Test write multiple coils."""
    context = MockContext(False)
    # too many values
    request = WriteMultipleCoilsRequest(2, FakeList(0x123456))
    result = request.execute(context)
    assert result.exception_code == ModbusExceptions.IllegalValue
    # bad byte count
    request = WriteMultipleCoilsRequest(2, [0x00] * 4)
    request.byte_count = 0x00
    result = request.execute(context)
    assert result.exception_code == ModbusExceptions.IllegalValue
    # does not validate
    context.valid = False
    request = WriteMultipleCoilsRequest(2, [0x00] * 4)
    result = request.execute(context)
    assert result.exception_code == ModbusExceptions.IllegalAddress
    # validated request
    context.valid = True
    result = request.execute(context)
    assert result.encode() == b"\x00\x02\x00\x04"