예제 #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)