예제 #1
0
파일: helpers.py 프로젝트: edx/codejail
 def setUp(self):
     super(JailMixin, self).setUp()
     if not jail.is_configured("python"):
         if not self._codejail_venv:
             self._codejail_venv = self._autoconfigure_codejail_venv()
         if not self._codejail_user:
             # User explicitly requested no su user via environment variable
             self._codejail_user = None
         bin_path = os.path.join(self._codejail_venv, 'bin/python2')
         jail.configure("python", bin_path, user=self._codejail_user, lang=languages.python2)
예제 #2
0
 def test_configure_jail(self):
     codejail_setting = FakeJailSettings({
         'jails': [{
             'command': 'fakey-fakey',
             'user': '******',
             'bin_path': '/usr/bin/python',
             'lang': languages.python3,
         }]
     })
     django_integration.configure_from_settings(codejail_setting)
     self.assertTrue(jail.is_configured('fakey-fakey'))
예제 #3
0
 def setUp(self):
     super(JailMixin, self).setUp()
     if not jail.is_configured("python"):
         if not self._codejail_venv:
             self._codejail_venv = self._autoconfigure_codejail_venv()
         if not self._codejail_user:
             # User explicitly requested no su user via environment variable
             self._codejail_user = None
         bin_path = os.path.join(self._codejail_venv, 'bin/python2')
         jail.configure("python",
                        bin_path,
                        user=self._codejail_user,
                        lang=languages.python2)
예제 #4
0
 def test_configure_jail(self):
     codejail_setting = FakeJailSettings({
         'jails': [
             {
                 'command': 'fakey-fakey',
                 'user': '******',
                 'bin_path': '/usr/bin/python',
                 'lang': languages.python3,
             }
         ]
     })
     django_integration.configure_from_settings(codejail_setting)
     self.assertTrue(jail.is_configured('fakey-fakey'))