forked from epfl-lasa/modulo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: default predicate value on construction
- Loading branch information
Showing
4 changed files
with
36 additions
and
6 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
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
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
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,23 @@ | ||
from modulo_core import Predicate | ||
|
||
|
||
def test_simple_predicate(): | ||
predicate = Predicate(lambda: True) | ||
assert predicate.get_value() | ||
assert predicate.query() | ||
assert predicate.get_value() | ||
assert predicate.query() is None | ||
|
||
predicate.set_predicate(lambda: False) | ||
assert predicate.get_value() is False | ||
assert predicate.query() is False | ||
assert predicate.get_value() is False | ||
assert predicate.query() is None | ||
|
||
|
||
def test_predicate_change_before_query(): | ||
predicate = Predicate(lambda: False) | ||
predicate.set_predicate(lambda: True) | ||
assert predicate.get_value() | ||
assert predicate.query() | ||
assert predicate.query() is None |