-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix is_point in ruleset.three_cushion (#173)
* Correction of error for three cushion scoring points. Added test template. * Added 10 test shots. Edited test_three_cushion.py. Test must be checked. * Edited test_three_cushion.py: corrected import of System for is_point call. Added path to test shot. * Edited test_three_cushion.py: corrected import of System for is_point call. * fixed path to test shots, by Evan * reformatted by pre-commit
- Loading branch information
Showing
12 changed files
with
40 additions
and
1 deletion.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,38 @@ | ||
from pathlib import Path | ||
|
||
from pooltool.ruleset.three_cushion import is_point | ||
from pooltool.system.datatypes import System | ||
|
||
root = Path(__file__).parent | ||
|
||
|
||
def test_three_cushion(): | ||
shot = System.load(root / "test_shots/01_test_shot_no_point.msgpack") | ||
assert not is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/01a_test_shot_no_point.msgpack") | ||
assert not is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/02_test_shot_ispoint.msgpack") | ||
assert is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/02a_test_shot_ispoint.msgpack") | ||
assert is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/03_test_shot_ispoint.msgpack") | ||
assert is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/03a_test_shot_ispoint.msgpack") | ||
assert is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/04_test_shot_no_point.msgpack") | ||
assert not is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/04a_test_shot_no_point.msgpack") | ||
assert not is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/05_test_shot_ispoint.msgpack") | ||
assert is_point(shot) | ||
|
||
shot = System.load(root / "test_shots/05a_test_shot_ispoint.msgpack") | ||
assert is_point(shot) |