Ejemplo n.º 1
0
def test_weighted_5():
    data = bson.Decimal128("5.5")
    assert Weighted(data) == (2, _cmp_decimal(data))
Ejemplo n.º 2
0
def test_weighted__cmp_decimal_le_or_ge():
    if PY3:
        with pytest.raises(TypeError):
            _cmp_decimal(bson.Decimal128("5.5")) >= "NAN"
    else:
        assert (_cmp_decimal(bson.Decimal128("5.5")) >= "NAN") is False
Ejemplo n.º 3
0
def test_weighted__cmp_decimal_err():
    with pytest.raises(TypeError):
        _cmp_decimal("Not_A_Decimal128")
Ejemplo n.º 4
0
def test_weighted__cmp_decimal_ne():
    assert _cmp_decimal(bson.Decimal128("5.5")) != "NAN"
Ejemplo n.º 5
0
def test_weighted_26():
    data = _cmp_decimal(bson.Decimal128("0.1"))
    assert Weighted(data) == (2, data)