Skip to content

Commit 4f00c2c

Browse files
tests updated, indentation fix (in plotter util)
1 parent 49b04c2 commit 4f00c2c

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

Utilities/PlotterUtil_GUI_v3.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,11 +953,8 @@ def _finalize_plot(self, x_col, y_col, selected_filepaths):
953953
legend_title = f"File: {os.path.basename(selected_filepaths[0])}"
954954
else:
955955
legend_title = "Multiple Files"
956-
957-
leg = self.ax_main.legend(title=legend_title,
958-
956+
leg = self.ax_main.legend(title=legend_title,
959957
labelcolor=self.CLR_CONSOLE_BG)
960-
961958
if leg:
962959

963960
leg.get_title().set_color(self.CLR_CONSOLE_BG)

tests/test_deep_simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def tearDown(self):
2424
def _timeout_handler(self, signum, frame):
2525
raise TimeoutError(
2626
f"Test {self._testMethodName} took longer than 30s! Infinite Loop suspected.")
27-
def run_module_safely(self, module_name, mock_modules): """Imports and runs a module with a strict 30-second timeout."""
27+
def run_module_safely(self, module_name, mock_modules): """Imports and runs a module with a strict 30-second timeout."""
2828
with patch.dict('sys.modules', mock_modules):
2929
# Set an alarm for 30 seconds (Works on Linux/GitHub Actions)
3030
if hasattr(signal, 'SIGALRM'):

tests/test_gui_iv_k2400.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Import the GUI class we want to test
66
from Keithley_2400.IV_K2400_GUI_v5 import MeasurementAppGUI
77

8+
89
class TestIVK2400GUI(unittest.TestCase):
910

1011
def setUp(self):
@@ -14,7 +15,7 @@ def setUp(self):
1415
"""
1516
# We need a root window for the GUI to be instantiated, but we don't need to see it.
1617
self.root = tk.Tk()
17-
self.root.withdraw() # Hide the window
18+
self.root.withdraw() # Hide the window
1819

1920
def tearDown(self):
2021
"""
@@ -40,12 +41,12 @@ def test_start_measurement_logic(self, mock_subplots, MockBackend):
4041
# --- Simulate User Input ---
4142
# We directly set the values that would be entered into the GUI's Entry widgets.
4243
app.entries["Sample Name"].insert(0, "TestSample")
43-
app.entries["Max Current"].insert(0, "100") # 100 µA
44-
app.entries["Step Current"].insert(0, "10") # 10 µA
45-
app.entries["Compliance"].insert(0, "20") # 20 V
46-
app.entries["Delay"].insert(0, "0.5") # 0.5 s
44+
app.entries["Max Current"].insert(0, "100") # 100 µA
45+
app.entries["Step Current"].insert(0, "10") # 10 µA
46+
app.entries["Compliance"].insert(0, "20") # 20 V
47+
app.entries["Delay"].insert(0, "0.5") # 0.5 s
4748
app.keithley_combobox.set("GPIB0::24::INSTR")
48-
app.file_location_path = "/fake/path" # Simulate browsing for a file
49+
app.file_location_path = "/fake/path" # Simulate browsing for a file
4950

5051
# --- Trigger the Action ---
5152
# Call the method that the "Start" button is connected to.

0 commit comments

Comments
 (0)