# Path: pymco/connector/activemq.py
# LOG = logging.getLogger(__name__)
# class ActiveMQConnector(Connector):
#     def __init__(self, config, connection=None, logger=LOG):
#     def send(self, msg, destination, *args, **kwargs):
#     def get_target(self, agent, collective):
#     def get_reply_target(self, agent, collective):
# 
# Path: pymco/test/utils.py
# def get_template(name, package=__package__):
# def configfile(ctxt=None):


import pytest
from pymco.connector import activemq
from pymco.test.utils import mock
"""Tests for pymco.connector.activemq"""




@pytest.fixture
def connector(config, conn_mock):
    return activemq.ActiveMQConnector(config=config, connection=conn_mock)


def test_get_target(connector):
    assert connector.get_target(collective='collective', agent='agent') == (
        '/topic/collective.agent.agent')


@mock.patch('os.getpid')
def test_get_reply_target(getpid, connector):
    getpid.return_value = 12345
    assert connector.get_reply_target(collective='collective', agent='agent') == (
        '/queue/collective.reply.mco1_12345')



# Path: pymco/connector/activemq.py
# LOG = logging.getLogger(__name__)
# class ActiveMQConnector(Connector):
#     def __init__(self, config, connection=None, logger=LOG):
#     def send(self, msg, destination, *args, **kwargs):
#     def get_target(self, agent, collective):
#     def get_reply_target(self, agent, collective):
# 
# Path: pymco/test/utils.py
# def get_template(name, package=__package__):
# def configfile(ctxt=None):


# Path: tests/unit/connector/test_activemq.py
import pytest
from pymco.connector import activemq
from pymco.test.utils import mock

"""Tests for pymco.connector.activemq"""




@pytest.fixture
def connector(config, conn_mock):
    return activemq.ActiveMQConnector(config=config, connection=conn_mock)


def test_get_target(connector):
    assert connector.get_target(collective='collective', agent='agent') == (
        '/topic/collective.agent.agent')


@mock.patch('os.getpid')
def test_get_reply_target(getpid, connector):
    getpid.return_value = 12345
    assert connector.get_reply_target(collective='collective', agent='agent') == (
        '/queue/collective.reply.mco1_12345')



@mock.patch('pymco.connector.Connector.security',