test_unitsystem.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Python-iBeacon-Scan 作者: NikNitro 项目源码 文件源码
def test_definition():
    # want to test if the system can have several units of the same dimension
    dm = Quantity("dm", length, Rational(1, 10))

    base = (m, s)
    base_dim = (m.dimension, s.dimension)
    ms = UnitSystem(base, (c, dm), "MS", "MS system")

    assert set(ms._base_units) == set(base)
    assert set(ms._units) == set((m, s, c, dm))
    #assert ms._units == DimensionSystem._sort_dims(base + (velocity,))
    assert ms.name == "MS"
    assert ms.descr == "MS system"

    assert ms._system._base_dims == DimensionSystem.sort_dims(base_dim)
    assert set(ms._system._dims) == set(base_dim + (velocity,))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号