-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for 'Point.op_GreaterThanOrEqual' method
- Loading branch information
1 parent
3c1fcce
commit 7618479
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from hypothesis import given | ||
|
||
from tests.binding import Point | ||
from tests.utils import (equivalence, | ||
implication) | ||
from . import strategies | ||
|
||
|
||
@given(strategies.points) | ||
def test_reflexivity(point: Point) -> None: | ||
assert point >= point | ||
|
||
|
||
@given(strategies.points, strategies.points) | ||
def test_antisymmetry(first: Point, second: Point) -> None: | ||
assert equivalence(first >= second >= first, first == second) | ||
|
||
|
||
@given(strategies.points, strategies.points, strategies.points) | ||
def test_transitivity(first: Point, second: Point, third: Point) -> None: | ||
assert implication(first >= second >= third, first >= third) | ||
|
||
|
||
@given(strategies.points, strategies.points) | ||
def test_alternatives(first: Point, second: Point) -> None: | ||
assert equivalence(first >= second, first > second or first == second) | ||
assert equivalence(first >= second, first > second or not first != second) | ||
assert equivalence(first >= second, second < first or not first != second) | ||
assert equivalence(first >= second, second < first or first == second) | ||
assert equivalence(first >= second, second <= first) | ||
assert equivalence(first >= second, not second > first) | ||
assert equivalence(first >= second, not first < second) |