Skip to content

Commit 6c8f64c

Browse files
Get the tests to work...
When evaluating the tests on my personal machine, I noticed that the test_main_application_window hung, so now I force it to exit. Also realized that I messed up the variable input arguments.
1 parent deeb3d0 commit 6c8f64c

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ navigate
1111
[![Tests](https://github.com/TheDeanLab/navigate/actions/workflows/push_checks.yaml/badge.svg)](https://github.com/TheDeanLab/navigate/actions/workflows/push_checks.yaml)
1212
[![codecov](https://codecov.io/gh/TheDeanLab/navigate/branch/develop/graph/badge.svg?token=270RFSZGG5)](https://codecov.io/gh/TheDeanLab/navigate)
1313

14-
Navigate is an open source Python package for control of light-sheet microscopes. It allows for easily reconfigurable hardware setups and automated acquisition rotuines.
14+
**navigate** is an open source Python package for control of light-sheet microscopes.
15+
It allows for easily reconfigurable hardware setups and automated acquisition rotuines.
1516

1617
### Quick install
1718

src/navigate/tools/main_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def evaluate_parser_input_arguments(args):
101101
), "experiment_file file Path {} not valid".format(args.experiment_file)
102102
experiment_path = args.experiment_file
103103

104-
if args.waveform_constants_path:
104+
if args.waveform_constants_file:
105105
assert (
106106
args.waveform_constants_path.exists()
107107
), "waveform_constants_path Path {} not valid".format(

test/controller/test_controller.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def controller(tk_root):
2727
waveform_templates_path = Path.joinpath(
2828
configuration_directory, "waveform_templates.yml"
2929
)
30+
gui_configuration_path = Path.joinpath(
31+
configuration_directory, "gui_configuration.yml"
32+
)
3033
args = SimpleNamespace(synthetic_hardware=True)
3134

3235
controller = Controller(
@@ -37,6 +40,7 @@ def controller(tk_root):
3740
waveform_constants_path,
3841
rest_api_path,
3942
waveform_templates_path,
43+
gui_configuration_path,
4044
args,
4145
)
4246
# To make sure the testcases won't hang on because of the model.event_queue

test/test_main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ def test_argument_parser(self):
5858
input_arguments = [
5959
"--config-file",
6060
"--experiment-file",
61-
"--waveform-constants-path",
61+
"--waveform-constants-file",
6262
"--rest-api-file",
6363
"--logging-config",
64+
"--gui-config-file",
6465
]
6566
for arg in input_arguments:
6667
parser.parse_args([arg, str(Path.joinpath(navigate_path, "test.yml"))])

test/view/test_main_application_window.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ def setUp(self):
7878
# Create a root Tkinter window for testing
7979
self.root = tk.Tk()
8080

81-
def tearDown(self):
82-
# Destroy the root window after each test
83-
self.root.destroy()
84-
8581
@patch(
8682
target="navigate.view.main_application_window.Path.joinpath",
8783
side_effect=tk.TclError,
8884
)
89-
@patch(target="navigate.view.main_application_window.SettingsNotebook", autospec=True)
85+
@patch(
86+
target="navigate.view.main_application_window.SettingsNotebook", autospec=True
87+
)
9088
def test_main_app_with_patched_joinpath(
9189
self, mock_settings_notebook, mock_joinpath
9290
):
9391
# Create an instance of main_application_window
9492
MainApp(self.root)
9593
self.root.update()
94+
self.root.destroy()
95+
pass

0 commit comments

Comments
 (0)