Skip to content

Commit

Permalink
added changes to parsing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbisurgi authored and MariusWirtz committed Nov 1, 2024
1 parent ef04c6e commit 4915b67
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 1 addition & 3 deletions rushti.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def parse_line_arguments(line: str) -> Dict[str, Any]:
elif key_lower == "succeed_on_minor_errors":
line_arguments[argument] = value.lower() in TRUE_VALUES
else:
# Store the argument-value pair as is
# Directly assign the value without stripping quotes
line_arguments[argument] = value

return line_arguments
Expand Down Expand Up @@ -880,7 +880,5 @@ def exit_rushti(
exit_rushti(
overall_success=success,
executions=len(results),
successes=sum(results),
start_time=start,
end_time=end,
elapsed_time=duration)
16 changes: 16 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@ def test_predecessors_and_require_predecessor_success(self):
'require_predecessor_success': True
}
self.assertEqual(result, expected)

def test_sql_query_parsing(self):
self.maxDiff = None
line = 'id="1" predecessors="" require_predecessor_success="" instance="tm1srv01" process="}bedrock.server.query" pQuery="SELECT Id,IsDeleted FROM Account WHERE date=\\"20241031092120\\"" pParam2="" pParam3="testing\\"2\\""'
result = parse_line_arguments(line)
expected = {
'id': '1',
'predecessors': [],
'require_predecessor_success': False,
'instance': 'tm1srv01',
'process': '}bedrock.server.query',
'pQuery': 'SELECT Id,IsDeleted FROM Account WHERE date="20241031092120"',
'pParam2': '',
'pParam3': 'testing"2"'
}
self.assertEqual(result, expected)


class TestSucceedOnMinorErrors(unittest.TestCase):
Expand Down

0 comments on commit 4915b67

Please sign in to comment.