SupySandbox: fix testProtections()

master
Valentin Lorentz 2010-12-23 16:09:59 +01:00
parent f50830242e
commit 525097416b
2 changed files with 6 additions and 6 deletions

View File

@ -50,6 +50,7 @@ import sys
import time
import random
import select
import signal
import resource as R
import supybot.utils as utils
from supybot.commands import *

View File

@ -33,24 +33,23 @@ from supybot.test import *
class SupySandboxTestCase(PluginTestCase):
plugins = ('SupySandbox',)
def testFschfschTestcase(self):
self.assertResponse('runtests', 'True')
def testCodeIsSuccessfullyRunned(self):
self.assertResponse('sandbox 1+1', "2")
self.assertResponse('sandbox print 1+1', "2")
self.assertResponse('sandbox print \'toto\'', "toto")
def testMultine(self):
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"'
' $$ toto=False', "foo")
def testProtections(self):
#self.assertResponse('sandbox while True: print 1', "Timeout")
pass
self.assertResponse('sandbox while True: pass', "Killed")
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: