コード例 #1
0
    def test_delete(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        exchange = Exchange('test')

        # test
        exchange.delete(TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.delete.assert_called_with(TEST_URL)
コード例 #2
0
ファイル: test_model.py プロジェクト: credativ/gofer
    def test_delete(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        exchange = Exchange('test')

        # test
        exchange.delete(TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.delete.assert_called_with(TEST_URL)
コード例 #3
0
    def test_unbind(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        queue = Mock()

        # test
        exchange = Exchange('test')
        exchange.unbind(queue, TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.unbind.assert_called_with(queue, TEST_URL)
コード例 #4
0
ファイル: test_model.py プロジェクト: credativ/gofer
    def test_unbind(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        queue = Mock()

        # test
        exchange = Exchange('test')
        exchange.unbind(queue, TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.unbind.assert_called_with(queue, TEST_URL)
コード例 #5
0
ファイル: test_model.py プロジェクト: credativ/gofer
    def test_declare(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        exchange = Exchange('test')
        exchange.durable = 1
        exchange.auto_delete = 2

        # test
        exchange.declare(TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.declare.assert_called_with(TEST_URL)
        self.assertEqual(impl.durable, exchange.durable)
        self.assertEqual(impl.auto_delete, exchange.auto_delete)
コード例 #6
0
    def test_declare(self, _find):
        plugin = Mock()
        _find.return_value = plugin
        exchange = Exchange('test')
        exchange.durable = 1
        exchange.auto_delete = 2

        # test
        exchange.declare(TEST_URL)

        # validation
        plugin.Exchange.assert_called_with(exchange.name, exchange.policy)
        impl = plugin.Exchange()
        impl.declare.assert_called_with(TEST_URL)
        self.assertEqual(impl.durable, exchange.durable)
        self.assertEqual(impl.auto_delete, exchange.auto_delete)
コード例 #7
0
 def test_neq(self):
     self.assertTrue(Exchange('1') != Exchange('2'))
     self.assertFalse(Exchange('1') != Exchange('1'))