GUI documentation
This commit is contained in:
@@ -153,12 +153,45 @@ class GuiConvenienceTests(unittest.TestCase):
|
||||
self.app.tree.selection_set("labels")
|
||||
self.app.update()
|
||||
labels_text = self._label_texts(self.app.form)
|
||||
self.assertIn("Arguments supplémentaires", labels_text)
|
||||
self.assertTrue(any("Cutleft" in text for text in labels_text))
|
||||
extra_label = next(
|
||||
child
|
||||
for child in self.app.form.winfo_children()
|
||||
if isinstance(child, ttk.Label)
|
||||
and str(child.cget("text")).startswith("Arguments supplémentaires")
|
||||
)
|
||||
tooltip = extra_label._copienator_tooltip
|
||||
self.assertIn("Cutleft", tooltip.text)
|
||||
self.assertFalse(any("Cutleft" in text for text in labels_text))
|
||||
|
||||
tooltip.show()
|
||||
self.app.update()
|
||||
self.assertIsNotNone(tooltip.window)
|
||||
self.assertIn("Cutleft", tooltip.window.winfo_children()[0].cget("text"))
|
||||
tooltip.hide()
|
||||
|
||||
self.app.tree.selection_set("plotting")
|
||||
self.app.update()
|
||||
self.assertNotIn("Arguments supplémentaires", self._label_texts(self.app.form))
|
||||
self.assertFalse(
|
||||
any(
|
||||
text.startswith("Arguments supplémentaires")
|
||||
for text in self._label_texts(self.app.form)
|
||||
)
|
||||
)
|
||||
|
||||
def test_each_visible_argument_label_has_a_tooltip(self):
|
||||
self.app.tree.selection_set("correction")
|
||||
self.app.update()
|
||||
argument_labels = [
|
||||
child
|
||||
for child in self.app.form.winfo_children()
|
||||
if isinstance(child, ttk.Label) and str(child.cget("text")).endswith("ⓘ")
|
||||
]
|
||||
self.assertGreaterEqual(len(argument_labels), 4)
|
||||
for label in argument_labels:
|
||||
with self.subTest(label=label.cget("text")):
|
||||
tooltip = getattr(label, "_copienator_tooltip", None)
|
||||
self.assertIsNotNone(tooltip)
|
||||
self.assertTrue(tooltip.text.strip())
|
||||
|
||||
def test_verbose_checkbox_updates_supported_commands(self):
|
||||
self.app.tree.selection_set("labels")
|
||||
|
||||
@@ -1829,6 +1829,13 @@ class WorkflowTests(unittest.TestCase):
|
||||
("live", "batch", "hybrid", "refaire"),
|
||||
)
|
||||
|
||||
def test_every_graphical_argument_has_tooltip_documentation(self) -> None:
|
||||
for step in self.steps.values():
|
||||
for spec in step.arguments:
|
||||
with self.subTest(step=step.id, argument=spec.name):
|
||||
self.assertTrue(spec.help.strip())
|
||||
self.assertTrue(spec.help.rstrip().endswith("."))
|
||||
|
||||
def test_options_previously_requiring_free_form_arguments_have_controls(self) -> None:
|
||||
status = self.command(
|
||||
"batch_status",
|
||||
|
||||
Reference in New Issue
Block a user