Skip to content

Commit

Permalink
Failing tests when pushed - works locally?
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhamer-noaa committed Dec 23, 2024
1 parent 1c0c742 commit 9e38894
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions python/idsse_common/test/test_rabbitmq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,49 +349,3 @@ def mock_blocking_publish(channel, exch, message_params, queue = None, success_f
assert EXAMPLE_UUID not in rpc_thread._pending_requests # request was cleaned up
assert result is None

@fixture
def rabbitmq_conn_params():
return Conn(host="localhost", v_host="/", port=5672, username="guest", password="guest")

def test_consumer_initialization(rabbitmq_conn_params, mock_connection, mock_channel):
mock_callback = MagicMock()
params_and_callbacks = [
((RMQ_PARAMS.exchange, RMQ_PARAMS.queue), mock_callback)
]

consumer = Consumer(rabbitmq_conn_params, params_and_callbacks)

# Assert connection and channel are created
assert consumer.connection is not None
assert consumer.channel is not None
assert consumer._consumer_tags is not None


def test_consumer_stop(rabbitmq_conn_params, mock_connection, mock_channel):
mock_callback = MagicMock()
params_and_callbacks = [
((RMQ_PARAMS.exchange, RMQ_PARAMS.queue), mock_callback)
]

consumer = Consumer(rabbitmq_conn_params, params_and_callbacks)
consumer.stop()

def test_publisher_initialization(rabbitmq_conn_params, mock_channel):
# pylint: disable=broad-exception-raised
# Set exchange to mandatory and test for UUID added to exchange name
exch = Exch('test_criteria_exch', 'topic', mandatory=True, delivery_conf=True)
pub1 = Publisher(rabbitmq_conn_params, exch)

# Assert connection and channel are created
assert pub1.connection is not None
assert pub1.channel is not None
assert pub1._queue.name != exch.name
if pub1.channel.confirm_delivery():
raise Exception('confirm delivery not switched on!')

pub2 = Publisher(rabbitmq_conn_params, RMQ_PARAMS.exchange)
assert pub2.connection is not None
assert pub2.channel is not None
assert pub2._queue is None
if pub1.channel.confirm_delivery():
raise Exception('confirm delivery switched on!')

0 comments on commit 9e38894

Please sign in to comment.