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)
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'))
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'))