Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Dec 13, 2023
1 parent 90f55b0 commit 6a91b1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
21 changes: 7 additions & 14 deletions src/silx/gui/plot/test/testPlotWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,32 +922,25 @@ def testPlotMarkerWithoutLegend(self):
def testPlotMarkerYAxis(self):
# Check only the API

legend = self.plot.addMarker(10, 10)
item = self.plot._getMarker(legend)
item = self.plot.addMarker(10, 10)
self.assertEqual(item.getYAxis(), "left")

legend = self.plot.addMarker(10, 10, yaxis="right")
item = self.plot._getMarker(legend)
item = self.plot.addMarker(10, 10, yaxis="right")
self.assertEqual(item.getYAxis(), "right")

legend = self.plot.addMarker(10, 10, yaxis="left")
item = self.plot._getMarker(legend)
item = self.plot.addMarker(10, 10, yaxis="left")
self.assertEqual(item.getYAxis(), "left")

legend = self.plot.addXMarker(10, yaxis="right")
item = self.plot._getMarker(legend)
item = self.plot.addXMarker(10, yaxis="right")
self.assertEqual(item.getYAxis(), "right")

legend = self.plot.addXMarker(10, yaxis="left")
item = self.plot._getMarker(legend)
item = self.plot.addXMarker(10, yaxis="left")
self.assertEqual(item.getYAxis(), "left")

legend = self.plot.addYMarker(10, yaxis="right")
item = self.plot._getMarker(legend)
item = self.plot.addYMarker(10, yaxis="right")
self.assertEqual(item.getYAxis(), "right")

legend = self.plot.addYMarker(10, yaxis="left")
item = self.plot._getMarker(legend)
item = self.plot.addYMarker(10, yaxis="left")
self.assertEqual(item.getYAxis(), "left")

self.plot.resetZoom()
Expand Down
4 changes: 2 additions & 2 deletions src/silx/gui/plot/test/testPlotWidgetNoBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def testSetDefaultColorsAddCurve(qWidgetFactory):
assert plot.getDefaultColors() == colors

# Check that the color index is reset
curve = plot.getCurve(plot.addCurve((1, 2), (0, 1), legend="newcurve"))
curve = plot.addCurve((1, 2), (0, 1), legend="newcurve")
assert curve.getColor() == rgba(colors[0])


Expand All @@ -678,7 +678,7 @@ def testDefaultColorsUpdateConfig(qWidgetFactory):
assert plot.getDefaultColors() == colors

# Check that the color index is reset
curve = plot.getCurve(plot.addCurve((1, 2), (0, 1), legend="newcurve"))
curve = plot.addCurve((1, 2), (0, 1), legend="newcurve")
assert curve.getColor() == rgba(colors[0])

finally:
Expand Down

0 comments on commit 6a91b1e

Please sign in to comment.