Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dice/core/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ def apply(self, item):
"""
def _name2path(name):
if not name.startswith(self.path_prefix):
raise ConstraintError(
"Solution %s is not a path variable" % name)
return name
return name[len(self.path_prefix):].replace('_', '/')

t = self._choose()
Expand Down
2 changes: 2 additions & 0 deletions dice/core/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def __repr__(self):
for line in self.trace:
if isinstance(line, ast.Compare):
s = str(line.ops[0].__class__.__name__)
elif isinstance(line, ast.Call):
s = line.func.id
else:
s = line.value.func.id
lines.append(s)
Expand Down
13 changes: 6 additions & 7 deletions examples/pyramid/oracles/pyramid.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
- name: option
target: option
tree: |
if self is Integer:
if self < 0:
oracle: |
if option is Integer:
if option < 0:
return FAIL('Min input is 0')
elif self > 9223372036854775808:
elif option > 9223372036854775808:
return FAIL('Number overflow')
elif self > 1000:
elif option > 1000:
return FAIL('Max input is 1000')
else:
return PASS()
return SUCCESS()
else:
return FAIL('Invalid number')
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ commands =
deps =
-rrequirements.txt
sphinx
sphinx_rtd_theme