Esempio n. 1
0
def test_unit_str():
    assert str(Units('kg')) == "units['kg']"
    assert (str(Units('counts/time',
                      DataShape(uint32))) == "units['counts/time', uint32]")
Esempio n. 2
0
def test_unit_construction():
    with pytest.raises(TypeError):
        Units(1)
    with pytest.raises(TypeError):
        Units('kg', 1)