summaryrefslogtreecommitdiff
path: root/t/unit/test_exceptions.py
blob: ca16b9a5acf7bb61b98e3f07284200ff825184b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from case import Mock
from amqp.exceptions import AMQPError, error_for_code


class test_AMQPError:

    def test_str(self):
        assert str(AMQPError())
        x = AMQPError(method_sig=(50, 60))
        assert str(x)


class test_error_for_code:

    def test_unknown_error(self):
        default = Mock(name='default')
        x = error_for_code(2134214314, 't', 'm', default)
        default.assert_called_with('t', 'm', reply_code=2134214314)
        assert x is default()