Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#180] Fix in the test_metta_api.py integration test #181

Merged
merged 3 commits into from
Mar 13, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[#182] Adding mkdocs.yml file for MkDocs page generation and GitHub Pages deployment
[#180] Fix in the test_metta_api.py integration test
13 changes: 10 additions & 3 deletions tests/integration/test_metta_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ def test_match_nested_expression(self):

answer = [query_answer for query_answer in das.query(query_3)]
assert len(answer) == 2
handle = answer[0].assignment.mapping["$v2"]

# Sort the answer list based on the handle
answer.sort(key=lambda x: x.assignment.mapping["$v2"])

handle = answer[1].assignment.mapping["$v2"]
assert handle == '9f27a331633c8bc3c49435ffabb9110e'
symbol = das.get_atom(handle)
assert symbol["type"] == "Symbol"
assert symbol["name"] == "2"
handle = answer[1].assignment.mapping["$v2"]
handle = answer[0].assignment.mapping["$v2"]
assert handle == '233d9a6da7d49d4164d863569e9ab7b6'
symbol = das.get_atom(handle)
assert symbol["type"] == "Expression"
Expand Down Expand Up @@ -137,8 +141,11 @@ def test_match_nested_expression(self):
)

answer = [query_answer for query_answer in das.query(query_4)]

assert len(answer) == 2

# Sort the answer list based on the $v handle
answer.sort(key=lambda x: x.assignment.mapping["$v"])

handle = answer[0].assignment.mapping["$v"]
assert handle == '963d66edfb77236054125e3eb866c8b5'
symbol = das.get_atom(handle)
Expand Down
Loading