Esempio n. 1
0
    def test_send_when_closing_causes_error(self):
        error = None

        conn = Connection("localhost", 1234)
        conn.closing = True

        try:
            yield conn.send(Mock())
        except exc.BrokerConnectionError as e:
            error = e

        self.assertEqual(error.host, "localhost")
        self.assertEqual(error.port, 1234)
Esempio n. 2
0
    def test_send_when_closing_causes_error(self):
        error = None

        conn = Connection("localhost", 1234)
        conn.closing = True

        try:
            yield conn.send(Mock())
        except exc.BrokerConnectionError as e:
            error = e

        self.assertEqual(error.host, "localhost")
        self.assertEqual(error.port, 1234)