コード例 #1
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_shift():
    u = 'foo @ 50'
    assert tex(u) == r'{foo} @ {50}'
コード例 #2
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_complex():
    u = 'microW^2 / (5^-2)π per sec @ 42'
    expected = r'{\frac{{\frac{{{\mu}W}^{2}}{{5}^{-2}}}\cdot{π}}{sec}} @ {42}'
    assert tex(u) == expected
コード例 #3
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_multiply():
    u = 'foo bar'
    assert tex(u) == r'{foo}\cdot{bar}'
コード例 #4
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_divide():
    u = 'foo per bar'
    assert tex(u) == r'\frac{foo}{bar}'
コード例 #5
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_identifier_micro():
    u = 'microW m-2'
    assert tex(u) == r'{{\mu}W}\cdot{{m}^{-2}}'
コード例 #6
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_raise():
    u = 'm^2'
    assert tex(u) == r'{m}^{2}'
コード例 #7
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_basic():
    u = "kg kg-1"
    assert tex(u) == r"{kg}\cdot{{kg}^{-1}}"
コード例 #8
0
ファイル: test_tex.py プロジェクト: rcomer/cf-units
def test_basic():
    u = 'kg kg-1'
    assert tex(u) == r'{kg}\cdot{{kg}^{-1}}'
コード例 #9
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_shift():
    u = "foo @ 50"
    assert tex(u) == r"{foo} @ {50}"
コード例 #10
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_divide():
    u = "foo per bar"
    assert tex(u) == r"\frac{foo}{bar}"
コード例 #11
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_multiply():
    u = "foo bar"
    assert tex(u) == r"{foo}\cdot{bar}"
コード例 #12
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_raise():
    u = "m^2"
    assert tex(u) == r"{m}^{2}"
コード例 #13
0
ファイル: test_tex.py プロジェクト: ocefpaf/cf-units
def test_identifier_micro():
    u = "microW m-2"
    assert tex(u) == r"{{\mu}W}\cdot{{m}^{-2}}"