Add unit tests for MapView functions #39

Merged
Vladislav merged 4 commits from project/gryshaiev-SCRUM112-test-coverage into dev 2026-03-31 15:30:55 +03:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit 058aac36c7 - Show all commits

View File

@@ -39,7 +39,11 @@ class Datasource:
self.connection_status = None
self._new_points = []
self._active_markers = []
asyncio.ensure_future(self.connect_to_server())
try:
asyncio.ensure_future(self.connect_to_server())
except RuntimeError:
Logger.info("No event loop detected, running in offline mode")
def get_new_points(self):
Logger.debug(self._new_points)

View File

@@ -3,7 +3,6 @@ import sys
from unittest.mock import Mock
sys.modules['lineMapLayer'] = Mock()
sys.modules['datasource'] = Mock()
sys.modules['config'] = Mock()
from MapView.main import get_lat_lon, MapViewApp
@@ -79,6 +78,7 @@ class TestMapLatLonToProcessedAgentData(unittest.TestCase):
result = self.instance.map_lat_lon_to_processed_agent_data(50.45, 30.52)
self.assertIsNotNone(result)
self.assertEqual(result, marker)
def test_empty_markers(self):
self.instance._active_markers = []