feat: add file comparison, data splitting, and sensor modification functionality to SessionController
This commit is contained in:
@@ -46,3 +46,34 @@ def test_pause_stop_timer(controller):
|
||||
controller.seek(2)
|
||||
controller.stop()
|
||||
assert controller.frameIndex == 0
|
||||
|
||||
def test_compare_files_integration(controller):
|
||||
# Mock the comparisonResult signal
|
||||
mock_slot = MagicMock()
|
||||
controller.comparisonResult.connect(mock_slot)
|
||||
|
||||
# Use sample_stream.csv for both arguments to test identical files compare
|
||||
csv_path = "tests/fixtures/sample_stream.csv"
|
||||
controller.compareFiles(csv_path, csv_path)
|
||||
|
||||
# Verify that the comparison signal is emitted with a success dict
|
||||
assert mock_slot.call_count == 1
|
||||
args = mock_slot.call_args[0][0]
|
||||
assert args["success"] is True
|
||||
assert "distance" in args
|
||||
assert "series_a" in args
|
||||
assert "series_b" in args
|
||||
|
||||
def test_split_data_integration(controller):
|
||||
# Mock the splitResult signal
|
||||
mock_slot = MagicMock()
|
||||
controller.splitResult.connect(mock_slot)
|
||||
|
||||
csv_path = "tests/fixtures/sample_stream.csv"
|
||||
controller.splitData(csv_path, 149.0)
|
||||
|
||||
# Verify that the split signal is emitted
|
||||
assert mock_slot.call_count == 1
|
||||
args = mock_slot.call_args[0][0]
|
||||
assert args["success"] is True
|
||||
assert "segments" in args
|
||||
Reference in New Issue
Block a user