Ejemplo n.º 1
0
def test_addition():
    assert solver.basic_operation(1, 1, solver.Operator.ADDITION) == 2
Ejemplo n.º 2
0
def test_not_numbers1():
    with pytest.raises(TypeError):
        solver.basic_operation('5', 0, solver.Operator.ADDITION)
Ejemplo n.º 3
0
def test_not_numbers2():
    with pytest.raises(TypeError):
        solver.basic_operation('5', 'm', solver.Operator.POWER)
Ejemplo n.º 4
0
def test_zero_division():
    with pytest.raises(ZeroDivisionError):
        solver.basic_operation(5, 0, solver.Operator.DIVISION)
Ejemplo n.º 5
0
def test_power():
    assert solver.basic_operation(5, 3, solver.Operator.POWER) == 125
Ejemplo n.º 6
0
def test_division():
    assert solver.basic_operation(5, 2, solver.Operator.DIVISION) == 2.5
Ejemplo n.º 7
0
def test_product():
    assert solver.basic_operation(5, 3, solver.Operator.PRODUCT) == 15
Ejemplo n.º 8
0
def test_substraction():
    assert solver.basic_operation(5.6, 2,
                                  solver.Operator.SUBSTRACTION) == 5.6 - 2