| 1 |
# This test code was written by the `hypothesis.extra.ghostwriter` module |
| 2 |
# and is provided under the Creative Commons Zero public domain dedication. |
| 3 |
|
| 4 |
import test_expected_output |
| 5 |
from hypothesis import given, strategies as st |
| 6 |
|
| 7 |
divide_operands = st.integers() |
| 8 |
|
| 9 |
|
| 10 |
@given(a=divide_operands, b=divide_operands, c=divide_operands) |
| 11 |
def test_associative_binary_operation_divide(a: int, b: int, c) -> None: |
| 12 |
left = test_expected_output.divide(a=a, b=test_expected_output.divide(a=b, b=c)) |
| 13 |
right = test_expected_output.divide(a=test_expected_output.divide(a=a, b=b), b=c) |
| 14 |
assert left == right, (left, right) |
| 15 |
|
| 16 |
|
| 17 |
@given(a=divide_operands, b=divide_operands) |
| 18 |
def test_commutative_binary_operation_divide(a: int, b: int) -> None: |
| 19 |
left = test_expected_output.divide(a=a, b=b) |
| 20 |
right = test_expected_output.divide(a=b, b=a) |
| 21 |
assert left == right, (left, right) |
| 22 |
|
| 23 |
|
| 24 |
@given(a=divide_operands) |
| 25 |
def test_identity_binary_operation_divide(a: int) -> None: |
| 26 |
identity = 1 |
| 27 |
assert a == test_expected_output.divide(a=a, b=identity) |
| 28 |
assert a == test_expected_output.divide(a=identity, b=a) |