예제 #1
0
def test_absolute_img_part_zero_division_error():
    c1 = ComplexNumber(0, 1)
    with pytest.raises(ZeroDivisionError):
        c1.absolute()
예제 #2
0
def test_absolute_complex_number():
    c1 = ComplexNumber(1, 2)

    result = c1.absolute()
    assert result == 63.435
예제 #3
0
def test_absolute_real_part():
    c1 = ComplexNumber(1, 0)

    result = c1.absolute()
    assert result == 0.00