Skip to content

Commit

Permalink
updated the gui tests with the cropped video
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrequ committed Apr 17, 2024
1 parent 2ae395d commit f32755d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 70 deletions.
Binary file modified tests/arcjet_test.mp4
Binary file not shown.
1 change: 0 additions & 1 deletion tests/test_10_150.json

This file was deleted.

20 changes: 10 additions & 10 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_switch_to_extract_edges_tab(app, qtbot):


def test_load_video(app, qtbot, mocker):
expected_video_path = os.path.join(find_tests_path(), "arcjet_test_2.mp4")
expected_video_path = os.path.join(find_tests_path(), "arcjet_test.mp4")
mocker.patch(
"PySide6.QtWidgets.QFileDialog.getOpenFileName",
return_value=(expected_video_path, ""),
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_apply_crop(app, qtbot, mocker):
"""
Test loading a video and then applying crop settings.
"""
expected_video_path = os.path.join(find_tests_path(), "arcjet_test_2.mp4")
expected_video_path = os.path.join(find_tests_path(), "arcjet_test.mp4")
mocker.patch(
"PySide6.QtWidgets.QFileDialog.getOpenFileName",
return_value=(expected_video_path, ""),
Expand All @@ -139,13 +139,13 @@ def test_apply_crop(app, qtbot, mocker):
assert app.video is not None
assert app.videometa is not None

app.ui.spinBox_crop_xmin.setValue(117)
app.ui.spinBox_crop_xmax.setValue(391)
app.ui.spinBox_crop_ymin.setValue(36)
app.ui.spinBox_crop_ymax.setValue(641)
app.ui.spinBox_crop_xmin.setValue(100)
app.ui.spinBox_crop_xmax.setValue(425)
app.ui.spinBox_crop_ymin.setValue(10)
app.ui.spinBox_crop_ymax.setValue(700)

qtbot.mouseClick(app.ui.applyCrop, Qt.LeftButton)
expected_crop_settings = [[36, 641], [117, 391]]
expected_crop_settings = [[10, 700], [100, 425]]
current_crop_settings = app.videometa.crop_range()

assert (
Expand All @@ -157,7 +157,7 @@ def test_toggle_show_crop_checkbox(app, qtbot, mocker):
"""
Test the functionality of the 'Show Crop' checkbox.
"""
expected_video_path = os.path.join(find_tests_path(), "arcjet_test_2.mp4")
expected_video_path = os.path.join(find_tests_path(), "arcjet_test.mp4")
mocker.patch(
"PySide6.QtWidgets.QFileDialog.getOpenFileName",
return_value=(expected_video_path, ""),
Expand Down Expand Up @@ -301,7 +301,7 @@ def test_load_analysis_files(app, qtbot, mocker):
"""
Test loading files in the 'Analysis' tab and verifying UI updates.
"""
expected_file_path = os.path.join(find_tests_path(), "arcjet_test_2_150_400.json")
expected_file_path = os.path.join(find_tests_path(), "arcjet_test_150_400.json")
mocker.patch(
"PySide6.QtWidgets.QFileDialog.getOpenFileNames",
return_value=([expected_file_path], ""),
Expand All @@ -317,7 +317,7 @@ def test_plot_data_button(app, qtbot, mocker):
Test the 'Plot Data' button functionality in the 'Analysis' tab after loading analysis files.
"""

expected_file_path = os.path.join(find_tests_path(), "arcjet_test_2_150_400.json")
expected_file_path = os.path.join(find_tests_path(), "arcjet_test_150_400.json")
mocker.patch(
"PySide6.QtWidgets.QFileDialog.getOpenFileNames",
return_value=([expected_file_path], ""),
Expand Down
96 changes: 37 additions & 59 deletions tutorial.ipynb

Large diffs are not rendered by default.

0 comments on commit f32755d

Please sign in to comment.