Skip to content

Commit db89221

Browse files
committed
fixup! feat!: remove support for local CodeJail
1 parent d106c01 commit db89221

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎xblocks_contrib/problem/capa/safe_exec/tests/test_safe_exec.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import pytest
1010
import random2 as random
1111
from codejail.safe_exec import SafeExecException
12+
from django.core.exceptions import ImproperlyConfigured
13+
from django.test import override_settings
1214
from six import unichr
1315

1416
from xblocks_contrib.problem.capa.safe_exec import safe_exec, update_hash
@@ -42,6 +44,12 @@ def make_python_library_zip_bytes():
4244
class TestSafeExec(unittest.TestCase):
4345
"""Unit tests for verifying functionality and restrictions of safe_exec."""
4446

47+
@override_settings(ENABLE_CODEJAIL_REST_SERVICE=False)
48+
def test_safe_exec_requires_remote_service(self):
49+
"""Verify safe_exec raises ImproperlyConfigured when remote service is disabled."""
50+
with pytest.raises(ImproperlyConfigured):
51+
safe_exec("a = 1", {})
52+
4553
def test_set_values(self):
4654
"""Verify assignment of values in safe_exec."""
4755
g = {}

0 commit comments

Comments
 (0)