Skip to content

Commit c7076d1

Browse files
committed
CCM-12616: Attempt to fix mesh-poll lambda's packaging
1 parent b066e55 commit c7076d1

File tree

14 files changed

+23
-28
lines changed

14 files changed

+23
-28
lines changed

lambdas/mesh-poll/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ install-dev:
88
pip install -r requirements-dev.txt
99

1010
test:
11-
cd ../.. && PYTHONPATH=lambdas/mesh-poll:$$PYTHONPATH pytest lambdas/mesh-poll/src/__tests__/ -v
11+
cd ../.. && PYTHONPATH=lambdas/mesh-poll:$$PYTHONPATH pytest lambdas/mesh-poll/mesh_poll/__tests__/ -v
1212

1313
coverage:
14-
cd ../.. && PYTHONPATH=lambdas/mesh-poll:$$PYTHONPATH pytest lambdas/mesh-poll/src/__tests__/ \
15-
--cov=lambdas/mesh-poll/src \
14+
cd ../.. && PYTHONPATH=lambdas/mesh-poll:$$PYTHONPATH pytest lambdas/mesh-poll/mesh_poll/__tests__/ \
15+
--cov=lambdas/mesh-poll/mesh_poll \
1616
--cov-config=lambdas/mesh-poll/pytest.ini \
1717
--cov-report=html:lambdas/mesh-poll/htmlcov \
1818
--cov-report=term-missing \
File renamed without changes.

lambdas/mesh-poll/src/__tests__/test_handler.py renamed to lambdas/mesh-poll/mesh_poll/__tests__/test_handler.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def setup_mocks():
3535
class TestHandler:
3636
"""Test suite for Lambda handler"""
3737

38-
@patch('src.handler.Config')
39-
@patch('src.handler.SenderLookup')
40-
@patch('src.handler.MeshMessageProcessor')
41-
@patch('src.handler.client')
38+
@patch('mesh_poll.handler.Config')
39+
@patch('mesh_poll.handler.SenderLookup')
40+
@patch('mesh_poll.handler.MeshMessageProcessor')
41+
@patch('mesh_poll.handler.client')
4242
def test_handler_success(self, mock_boto_client, mock_processor_class, mock_sender_lookup_class, mock_config_class):
4343
"""Test successful handler execution"""
44-
from src.handler import handler
44+
from mesh_poll.handler import handler
4545

4646
(mock_context, mock_config, mock_ssm,
4747
mock_sender_lookup, mock_processor) = setup_mocks()
@@ -82,13 +82,13 @@ def test_handler_success(self, mock_boto_client, mock_processor_class, mock_send
8282
# Verify process_messages was called
8383
mock_processor.process_messages.assert_called_once()
8484

85-
@patch('src.handler.Config')
86-
@patch('src.handler.SenderLookup')
87-
@patch('src.handler.MeshMessageProcessor')
88-
@patch('src.handler.client')
85+
@patch('mesh_poll.handler.Config')
86+
@patch('mesh_poll.handler.SenderLookup')
87+
@patch('mesh_poll.handler.MeshMessageProcessor')
88+
@patch('mesh_poll.handler.client')
8989
def test_handler_config_cleanup_on_exception(self, mock_boto_client, mock_processor_class, mock_sender_lookup_class, mock_config_class):
9090
"""Test that Config context manager cleanup is called even on exception"""
91-
from src.handler import handler
91+
from mesh_poll.handler import handler
9292

9393
(mock_context, mock_config, mock_ssm,
9494
mock_sender_lookup, mock_processor) = setup_mocks()

lambdas/mesh-poll/src/__tests__/test_processor.py renamed to lambdas/mesh-poll/mesh_poll/__tests__/test_processor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
Tests for mesh-poll MeshMessageProcessor
33
Following the pattern from backend comms-mgr mesh-poll tests
44
"""
5-
import pytest
65
from unittest.mock import Mock, call, patch
76
from mesh_client import MeshClient
8-
from src.processor import MeshMessageProcessor
7+
from mesh_poll.processor import MeshMessageProcessor
98

109

1110
def setup_mocks():
@@ -62,7 +61,7 @@ def get_remaining_time_in_millis_near_timeout():
6261
return 100
6362

6463

65-
@patch('src.processor.EventPublisher')
64+
@patch('mesh_poll.processor.EventPublisher')
6665
class TestMeshMessageProcessor:
6766
"""Test suite for MeshMessageProcessor"""
6867

lambdas/mesh-poll/src/__tests__/test_sender_lookup.py renamed to lambdas/mesh-poll/mesh_poll/__tests__/test_sender_lookup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
Tests for SenderLookup
33
"""
44
import json
5-
import pytest
65
from unittest.mock import Mock, call
7-
from src.sender_lookup import SenderLookup
6+
from mesh_poll.sender_lookup import SenderLookup
87

98

109
def setup_mocks():

0 commit comments

Comments
 (0)