diff --git a/test/test_svg.py b/test/test_svg.py index 4ef409b0..636a9201 100644 --- a/test/test_svg.py +++ b/test/test_svg.py @@ -59,7 +59,11 @@ def has_item(self, id: str, classes: Optional[List[str]] = None): def is_autogenerated(svg_filename: Path): tabletfile = datadir() / svg_filename.name.replace(".svg", ".tablet") - return any("autogenerated" in l for l in open(tabletfile)) if tabletfile.exists() else False + return ( + any("autogenerated" in l for l in open(tabletfile)) + if tabletfile.exists() + else False + ) def pytest_generate_tests(metafunc): @@ -68,7 +72,12 @@ def pytest_generate_tests(metafunc): db = load_test_db() devices = db.list_devices() devices = [ - SvgDevice(db, d, load_svg(d.layout_filename), is_autogenerated(Path(d.layout_filename))) + SvgDevice( + db, + d, + load_svg(d.layout_filename), + is_autogenerated(Path(d.layout_filename)), + ) for d in devices if d.layout_filename ] @@ -149,11 +158,15 @@ def test_svg_strips(stripdevice): try: if stripdevice.device.num_strips >= 1: stripdevice.has_item(id="Strip", classes=["Strip", "TouchStrip"]) - stripdevice.has_item(id="LabelStripUp", classes=["StripUp", "Strip", "Label"]) + stripdevice.has_item( + id="LabelStripUp", classes=["StripUp", "Strip", "Label"] + ) stripdevice.has_item( id="LabelStripDown", classes=["StripDown", "Strip", "Label"] ) - stripdevice.has_item(id="LeaderStripUp", classes=["StripUp", "Strip", "Leader"]) + stripdevice.has_item( + id="LeaderStripUp", classes=["StripUp", "Strip", "Leader"] + ) stripdevice.has_item( id="LeaderStripDown", classes=["StripDown", "Strip", "Leader"] ) @@ -185,13 +198,21 @@ def test_svg_dials(dialdevice): dialdevice.has_item(id="LabelDialCW", classes=["DialCW", "Dial", "Label"]) dialdevice.has_item(id="LabelDialCCW", classes=["DialCCW", "Dial", "Label"]) dialdevice.has_item(id="LeaderDialCW", classes=["DialCW", "Dial", "Leader"]) - dialdevice.has_item(id="LeaderDialCCW", classes=["DialCCW", "Dial", "Leader"]) + dialdevice.has_item( + id="LeaderDialCCW", classes=["DialCCW", "Dial", "Leader"] + ) if dialdevice.device.num_dials >= 2: dialdevice.has_item(id="Dial2", classes=["Dial2", "TouchDial"]) - dialdevice.has_item(id="LabelDial2CW", classes=["Dial2CW", "Dial2", "Label"]) - dialdevice.has_item(id="LabelDial2CCW", classes=["Dial2CCW", "Dial2", "Label"]) - dialdevice.has_item(id="LeaderDial2CW", classes=["Dial2CW", "Dial2", "Leader"]) + dialdevice.has_item( + id="LabelDial2CW", classes=["Dial2CW", "Dial2", "Label"] + ) + dialdevice.has_item( + id="LabelDial2CCW", classes=["Dial2CCW", "Dial2", "Label"] + ) + dialdevice.has_item( + id="LeaderDial2CW", classes=["Dial2CW", "Dial2", "Leader"] + ) dialdevice.has_item( id="LeaderDial2CCW", classes=["Dial2CCW", "Dial2", "Leader"] )