diff --git a/src/pyefis/instruments/gauges/arc.py b/src/pyefis/instruments/gauges/arc.py index 15127808..35f3a765 100644 --- a/src/pyefis/instruments/gauges/arc.py +++ b/src/pyefis/instruments/gauges/arc.py @@ -91,7 +91,8 @@ def resizeEvent(self, event): elif self.name_location == 'right': self.nameFontSize = helpers.fit_to_mask(self.r_width / 2.1, (self.r_height / 2.8)/2, self.name_font_mask, self.font_family) else: - raise SyntaxError(f"Unknown location: {self.name_location}") + # Should we throw exception or log error here? + pass def paintEvent(self, e): start = self.startAngle @@ -243,7 +244,8 @@ def paintEvent(self, e): else: p.drawText(QPointF( self.lrcx - x, self.lrcy - (y/1.1) ), self.name) else: - raise SyntaxError(f"Unknown location: {self.name_location}") + # Should we throw exception or log error here? + pass # Main value text if self.font_mask: opt = QTextOption(Qt.AlignRight) diff --git a/tests/instruments/gauges/test_arc.py b/tests/instruments/gauges/test_arc.py index 21504a54..0820b623 100644 --- a/tests/instruments/gauges/test_arc.py +++ b/tests/instruments/gauges/test_arc.py @@ -112,3 +112,17 @@ def test_arc_gauge_branches(fix,qtbot): widget.show() qtbot.waitExposed(widget) qtbot.wait(2000) + + +def test_unknown_location(fix,qtbot): + widget = gauges.ArcGauge(min_size=False) + assert widget.getRatio() == 2 + widget.setDbkey("NUM") + widget.setupGauge() + qtbot.addWidget(widget) + widget.name_location = 'unknown' + widget.name_font_mask = "XXX" + hmi.initialize({}) + widget.resize(100,100) + widget.show() + widget.paintEvent(None)