'Test that typeof() finds an exchange that already exists.'

def test_typeof_exchange_exists(self):

    mock_exchange = Mock()
    mock_qpid_exchange = Mock()
    mock_attributes = {}
    mock_type = Mock()
    mock_attributes[u'type'] = mock_type
    mock_qpid_exchange.getAttributes.return_value = mock_attributes
    self.mock_broker.getExchange.return_value = mock_qpid_exchange
    result = self.my_channel.typeof(mock_exchange)
    assert (mock_type is result)
