Skip to content

Commit

Permalink
add test for sigan registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed Jan 9, 2024
1 parent 71da125 commit b2022e4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scos_actions/discover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
from scos_actions.hardware.mocks.mock_gps import MockGPS
from scos_actions.hardware.mocks.mock_sigan import MockSignalAnalyzer
from scos_actions.settings import ACTION_DEFINITIONS_DIR, MOCK_SIGAN
from scos_actions.signals import register_component_with_status
from scos_actions.signals import (
register_component_with_status,
register_signal_analyzer,
)

mock_sigan = MockSignalAnalyzer(randomize_values=True)
mock_gps = MockGPS()
if MOCK_SIGAN:
register_component_with_status.send(mock_sigan.__class__, component=mock_sigan)
register_signal_analyzer.send(__name__, signal_analzyer=mock_sigan)
actions = {"logger": Logger()}
test_actions = {
"test_sync_gps": SyncGps(
Expand Down
10 changes: 10 additions & 0 deletions scos_actions/discover/tests/test_sigan_registration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest
from scos_actions.core import signal_analyzer_monitor
from scos_actions.signals import register_signal_analyzer
from scos_actions.hardware.mocks.mock_sigan import MockSignalAnalyzer


def test_sigan_registration():
sigan = MockSignalAnalyzer()
register_signal_analyzer.send(__name__, signal_analyzer=sigan)
assert signal_analyzer_monitor.signal_analyzer == sigan
2 changes: 1 addition & 1 deletion scos_actions/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# Provides argument 'action'
register_action = Signal()

# Provides argument 'sigan'
# Provides argument 'signal_analyzer'
register_signal_analyzer = Signal()

0 comments on commit b2022e4

Please sign in to comment.