def test_quantity():
    v = 1 * pq.m/pq.s

    q1 = Quantity(v)
    assert q1.dumps() == r'\SI{1.0}{\meter\per\second}'

    q2 = Quantity(v, format_cb=lambda x: str(int(x)))
    assert q2.dumps() == r'\SI{1}{\meter\per\second}'

    q3 = Quantity(v, options={'zero-decimal-to-integer': 'true'})
    ref = r'\SI[zero-decimal-to-integer=true]{1.0}{\meter\per\second}'
    assert q3.dumps() == ref
dataset/ETHPy150Open JelteF/PyLaTeX/tests/test_quantities.py/test_quantity/original