Skip to content

Commit

Permalink
[unit_test] failing test due to precedence error
Browse files Browse the repository at this point in the history
  • Loading branch information
mbalunovic committed Jul 19, 2024
1 parent 67aeeca commit 70d0f39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ def test_with_member_access_call_in_addition(self):
(to: ToolOutput)
"File " + tc.function.arguments.arg.strip() + " not found" in to.content
""")

self.assertIsInstance(policy.statements[0].body[1], ast.BinaryExpr)
self.assertIsInstance(policy.statements[0].body[1].left, ast.BinaryExpr)
self.assertIsInstance(policy.statements[0].body[1].left.left, ast.BinaryExpr)
Expand All @@ -387,5 +386,14 @@ def test_with_member_access_call_in_addition(self):
self.assertEqual(policy.statements[0].body[1].left.left.right.name.expr.expr.expr.member, "function")
self.assertIsInstance(policy.statements[0].body[1].left.left.right.name.expr.expr.expr.expr, ast.Identifier)

def test_assign_in(self):
policy = parse("""
raise "error" if:
(msg: Message)
flag := ["a", "b"] in ["a"]
""")
self.assertEqual(policy.statements[0].body[1].op, ":=")


if __name__ == "__main__":
unittest.main()

0 comments on commit 70d0f39

Please sign in to comment.