Пример #1
0
def test_div_base_derived():
    assert u.v / u.a == u.DerivedUnit("volt / ampere", "kg·m²·s⁻³·A⁻²",
                                      [(u.kg, 1), (u.m, 2), (u.s, -3),
                                       (u.a, -2)], "potential / current")
Пример #2
0
def test_div_derived():
    assert u.ohm / u.f == u.DerivedUnit("ohm / farad", "kg²·m⁴·s⁻⁷·A⁻⁴",
                                        [(u.kg, 2), (u.m, 4), (u.s, -7),
                                         (u.a, -4)],
                                        "resistance / capacitance")
Пример #3
0
def test_div_base():
    assert u.a / u.cd**2 == u.DerivedUnit("ampere / candela²", "A·cd⁻²",
                                          [(u.a, 1),
                                           (u.cd, -2)], "current / luminosity")
Пример #4
0
def test_mul_base_derived():
    assert u.a * u.v == u.DerivedUnit("ampere·volt", "kg·m²·s⁻³", [(u.kg, 1),
                                                                   (u.m, 2),
                                                                   (u.s, -3)],
                                      "potential · current")
Пример #5
0
def test_mul_derived():
    assert u.ohm * u.f == u.DerivedUnit("ohm · farad", "s", [(u.s, 1)],
                                        "resistance · capacitance")
Пример #6
0
def test_mul_base():
    assert u.kg * u.s == u.DerivedUnit("kilogram · meter", "kg·m", [(u.kg, 1),
                                                                    (u.s, 1)],
                                       "mass · distance")