SupySandbox: fix testProtections()
This commit is contained in:
parent
f50830242e
commit
525097416b
@ -50,6 +50,7 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
import select
|
import select
|
||||||
|
import signal
|
||||||
import resource as R
|
import resource as R
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
from supybot.commands import *
|
from supybot.commands import *
|
||||||
|
@ -33,24 +33,23 @@ from supybot.test import *
|
|||||||
|
|
||||||
class SupySandboxTestCase(PluginTestCase):
|
class SupySandboxTestCase(PluginTestCase):
|
||||||
plugins = ('SupySandbox',)
|
plugins = ('SupySandbox',)
|
||||||
|
|
||||||
def testFschfschTestcase(self):
|
def testFschfschTestcase(self):
|
||||||
self.assertResponse('runtests', 'True')
|
self.assertResponse('runtests', 'True')
|
||||||
|
|
||||||
def testCodeIsSuccessfullyRunned(self):
|
def testCodeIsSuccessfullyRunned(self):
|
||||||
self.assertResponse('sandbox 1+1', "2")
|
self.assertResponse('sandbox 1+1', "2")
|
||||||
self.assertResponse('sandbox print 1+1', "2")
|
self.assertResponse('sandbox print 1+1', "2")
|
||||||
self.assertResponse('sandbox print \'toto\'', "toto")
|
self.assertResponse('sandbox print \'toto\'', "toto")
|
||||||
|
|
||||||
def testMultine(self):
|
def testMultine(self):
|
||||||
self.assertResponse('sandbox print 1; print 2', "'1\\n2'")
|
self.assertResponse('sandbox print 1; print 2', "'1\\n2'")
|
||||||
self.assertResponse('sandbox print 1 $$ print 2', "'1\\n2'")
|
self.assertResponse('sandbox print 1 $$ print 2', "'1\\n2'")
|
||||||
self.assertResponse('sandbox toto=True $$ while toto: $$ print "foo"'
|
self.assertResponse('sandbox toto=True $$ while toto: $$ print "foo"'
|
||||||
' $$ toto=False', "foo")
|
' $$ toto=False', "foo")
|
||||||
|
|
||||||
def testProtections(self):
|
def testProtections(self):
|
||||||
#self.assertResponse('sandbox while True: print 1', "Timeout")
|
self.assertResponse('sandbox while True: pass', "Killed")
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user