def METHOD_NAME(self, test_object):
    """Test update_limits and (if not read_oinly) set_limits"""
    limits = test_object.get_limits()
    if limits != (None, None):
        test_object.update_limits((None, None))
        assert test_object._nominal_limits == (
            None,
            None,
        ), "Update limits to (None, None) but _nominal_limits value is %s" % (
            test_object._nominal_limits,
        )
        test_object.update_limits(limits)
        assert (
            test_object._nominal_limits == limits
        ), "Updated limits to %s but _nominal_limits is %s" % (
            limits,
            test_object._nominal_limits,
        )
        if not test_object.read_only:
            # Must be set to (None, None) so the next command causes a change
            test_object._nominal_limits = (None, None)
            test_object.set_limits(limits)
            assert (
                test_object._nominal_limits == limits
            ), "Set limits to %s but _nominal_limits is %s" % (
                limits,
                test_object._nominal_limits,
            )