Пример #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)
Пример #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)
Пример #3
0
def test_dimension_neq_length_lengthsq():
    length = mtr.Dimension(L=1)
    lengthsq = mtr.Dimension(L=2)

    assert length != lengthsq
Пример #4
0
def test_dimension_str_time():
    time = mtr.Dimension(T=1)

    assert str(time) == "T"
Пример #5
0
def test_dimension_neq_length_time():
    length = mtr.Dimension(L=1)
    time = mtr.Dimension(T=1)

    assert length != time
Пример #6
0
def test_dimension_eq_length():
    length = mtr.Dimension(L=1)

    assert length == length
Пример #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)
Пример #8
0
def test_dimension_str_mass():
    mass = mtr.Dimension(M=1)

    assert str(mass) == "M"
Пример #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)