pyqtgraph/tests/graphicsItems/test_TextItem.py

24 lines
400 B
Python

import pytest
import pyqtgraph as pg
app = pg.mkQApp()
def test_TextItem_setAngle():
plt = pg.plot()
plt.setXRange(-10, 10)
plt.setYRange(-20, 20)
item = pg.TextItem(text="test")
plt.addItem(item)
t1 = item.transform()
item.setAngle(30)
app.processEvents()
t2 = item.transform()
assert t1 != t2
assert not t1.isRotating()
assert t2.isRotating()