Skip to content

Commit

Permalink
ci: add tests for python3.11 and python3.12. Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Apr 26, 2024
1 parent 16413eb commit b49c583
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ on:

jobs:
build:

name: tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions codejailservice/tests/test_code_exec_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def test_unsafe_code_exec_failure(self, import_code_jail_safe_exec):
data={"payload": json.dumps(payload)},
)
self.assertEqual(200, response.status_code)
self.assertIn(expected_result.pop("emsg"), response.json["emsg"])
self.assertDictContainsSubset(expected_result, response.json)
self.assertEqual(expected_result['emsg'], response.json["emsg"])
self.assertEqual(expected_result['globals_dict'], response.json["globals_dict"])

@mock.patch("codejailservice.routes.code_exec_service.import_code_jail_safe_exec")
def test_safe_code_exec_failure(self, import_code_jail_safe_exec):
Expand Down Expand Up @@ -190,5 +190,5 @@ def test_safe_code_exec_failure(self, import_code_jail_safe_exec):
data={"payload": json.dumps(payload)},
)
self.assertEqual(200, response.status_code)
self.assertIn(expected_result.pop("emsg"), response.json["emsg"])
self.assertDictContainsSubset(expected_result, response.json)
self.assertEqual(expected_result['emsg'], response.json["emsg"])
self.assertEqual(expected_result['globals_dict'], response.json["globals_dict"])

0 comments on commit b49c583

Please sign in to comment.