Esempio n. 1
0
def test_dimension_mul():
    length = mtr.Dimension(L=1)
    time = mtr.Dimension(T=1)

    assert (length * time)._d == dict(L=1, T=1, M=0, A=0, K=0, N=0, J=0)
Esempio n. 2
0
def test_dimension_imul():
    length = mtr.Dimension(L=1)
    time = mtr.Dimension(T=1)
    length *= time

    assert length._d == dict(L=1, T=1, M=0, A=0, K=0, N=0, J=0)
Esempio n. 3
0
def test_dimension_neq_length_lengthsq():
    length = mtr.Dimension(L=1)
    lengthsq = mtr.Dimension(L=2)

    assert length != lengthsq
Esempio n. 4
0
def test_dimension_str_time():
    time = mtr.Dimension(T=1)

    assert str(time) == "T"
Esempio n. 5
0
def test_dimension_neq_length_time():
    length = mtr.Dimension(L=1)
    time = mtr.Dimension(T=1)

    assert length != time
Esempio n. 6
0
def test_dimension_eq_length():
    length = mtr.Dimension(L=1)

    assert length == length
Esempio n. 7
0
def test_dimension_ipow_zero():
    length = mtr.Dimension(L=1)
    length **= 0

    assert length._d == dict(L=0, T=0, M=0, A=0, K=0, N=0, J=0)
Esempio n. 8
0
def test_dimension_str_mass():
    mass = mtr.Dimension(M=1)

    assert str(mass) == "M"
Esempio n. 9
0
def test_dimension_ipow_negative():
    length = mtr.Dimension(L=1)
    length **= -2

    assert length._d == dict(L=-2, T=0, M=0, A=0, K=0, N=0, J=0)