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:
Talley Lambert
2022-11-01 14:46:29 -04:00
committed by GitHub
parent 7f50e69e28
commit 021f164419
4 changed files with 19 additions and 4 deletions

View File

@@ -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")