mirror of
https://github.com/pyapp-kit/superqt.git
synced 2025-12-15 18:50:05 +01:00
fix: fix quantity set value and add test (#131)
* fix: fix quantity set value and add test * pin pyside6 * fix: try fix screenshot
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from pint import Quantity
|
||||
|
||||
from superqt import QQuantity
|
||||
|
||||
|
||||
@@ -29,3 +31,11 @@ def test_qquantity(qtbot):
|
||||
assert w.isDimensionless()
|
||||
assert w.unitsComboBox().currentText() == "-----"
|
||||
assert w.magnitude() == 1
|
||||
|
||||
|
||||
def test_change_qquantity_value(qtbot):
|
||||
w = QQuantity()
|
||||
qtbot.addWidget(w)
|
||||
assert w.value() == Quantity(0)
|
||||
w.setValue(Quantity("1 meter"))
|
||||
assert w.value() == Quantity("1 meter")
|
||||
|
||||
Reference in New Issue
Block a user