def test_operationtimeout_str_def(self, msg, operation_timeout):
        """All tests for OperationTimeout.str_def()."""

        exc = OperationTimeout(msg, operation_timeout)

        classname = exc.__class__.__name__

        # Execute the code to be tested
        str_def = exc.str_def()

        str_def = ' ' + str_def
        assert str_def.find(' classname={!r};'.format(classname)) >= 0
        assert str_def.find(' message={!r};'.format(msg)) >= 0
        assert str_def.find(
            ' operation_timeout={!r};'.format(operation_timeout)) >= 0
    def test_operationtimeout_str(self, msg, operation_timeout):
        """All tests for OperationTimeout.__str__()."""

        exc = OperationTimeout(msg, operation_timeout)

        exp_str = str(exc.args[0])

        # Execute the code to be tested
        str_str = str(exc)

        assert str_str == exp_str
    def test_operationtimeout_initial_attrs(self, arg_names, args):
        """Test initial attributes of OperationTimeout."""

        msg, operation_timeout = args
        posargs, kwargs = func_args(args, arg_names)

        # Execute the code to be tested
        exc = OperationTimeout(*posargs, **kwargs)

        assert isinstance(exc, Error)
        assert len(exc.args) == 1
        assert exc.args[0] == msg
        assert exc.operation_timeout == operation_timeout
    def test_operationtimeout_repr(self, msg, operation_timeout):
        """All tests for OperationTimeout.__repr__()."""

        exc = OperationTimeout(msg, operation_timeout)

        classname = exc.__class__.__name__

        # Execute the code to be tested
        repr_str = repr(exc)

        # We check the one-lined string just roughly
        repr_str = repr_str.replace('\n', '\\n')
        assert re.match(r'^{}\s*\(.*\)$'.format(classname), repr_str)