-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(up): Add UP tests specific to aries in the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from unified_planning.shortcuts import * | ||
from unified_planning.test import TestCase | ||
import unified_planning.model.scheduling as sched | ||
|
||
|
||
def get_test_cases(): | ||
"""Creates on test case for each function starting with `test_` in the file""" | ||
res = {} | ||
gens = [(name.removeprefix('test_'), fn) for name, fn in globals().items() | ||
if callable(fn) and fn.__module__ == __name__ and name.startswith('test_')] | ||
|
||
for (name, generator) in gens: | ||
print(name) | ||
res[name] = generator() | ||
|
||
return res | ||
|
||
|
||
def test_sched_bool_param(): | ||
problem = sched.SchedulingProblem() | ||
|
||
a = problem.add_activity('a', 10) | ||
|
||
a.add_parameter('p', BoolType()) | ||
|
||
return TestCase(problem=problem, solvable=True) |