Exemple #1
0
def test_mul():
    result = m.mul(558, 221)
    assert result == 558 * 221
Exemple #2
0
def test_sub_zero():
    result = m.sub(558, 0)
    assert result == 558 - 0
Exemple #3
0
def test_sub_minus():
    result = m.sub(558, 1111)
    assert result == 558 - 1111
Exemple #4
0
def test_div_zero():
    with pytest.raises(ZeroDivisionError):
        result = m.div(558, 0)
Exemple #5
0
def test_fact_zero() :
    result = m.fact(0)
    assert result == 1
Exemple #6
0
def test_mul_minus():
    result = m.mul(558, -55)
    assert result == 558 * -55
Exemple #7
0
def test_div_float():
    result = m.div(558, 2.)
    assert result == 558 / 2.
Exemple #8
0
def test_root_zero():
    result = m.n_root(2, 0)
    assert result == 0
Exemple #9
0
def test_root():
    result = m.n_root(64, 2)
    assert result == math.sqrt(64)
Exemple #10
0
def test_root_2():
    result = m.n_root(555, 2)
    assert result == round(math.sqrt(555), 13)
Exemple #11
0
def test_root_neg():
    with pytest.raises(ValueError):
        result = m.n_root(-55, 2)
Exemple #12
0
def test_fact() :
    result = m.fact(3)
    assert result == 6
Exemple #13
0
def test_fact_float() :
    with pytest.raises(ValueError) :
        result = m.fact(8.99)
Exemple #14
0
def test_fact_zero_float() :
    with pytest.raises(ValueError) :
        result = m.fact(0.25)
Exemple #15
0
def test_mul_float():
    result = m.mul(558, 221.555)
    assert result == 558 * 221.555
Exemple #16
0
def test_add_float():
    result = m.add(558, 221.)
    assert result == 558 + 221.
Exemple #17
0
def test_mul_zero():
    result = m.mul(558, 0)
    assert result == 558 * 0
Exemple #18
0
def test_add_float_2():
    result = m.add(558.55, 221.9)
    assert result == 558.55 + 221.9
Exemple #19
0
def test_div():
    result = m.div(558, 221)
    assert result == 558 / 221
Exemple #20
0
def test_sub():
    result = m.sub(558, 221)
    assert result == 558 - 221
Exemple #21
0
def test_div_float_2():
    result = m.div(558.444, 221.1)
    assert result == 558.444 / 221.1
Exemple #22
0
def test_sub_float():
    result = m.sub(558.88, 221)
    assert result == 558.88 - 221
Exemple #23
0
def test_add():
    result = m.add(558, 221)
    assert result == 558 + 221
Exemple #24
0
def test_fact_neg() :
    with pytest.raises(ValueError) :
        result = m.fact(-3)