diff options
author | 2018-07-05 17:32:05 +0200 | |
---|---|---|
committer | 2018-07-05 17:32:05 +0200 | |
commit | 76de48ad774c548809dc54de9255a597fc56777b (patch) | |
tree | d991fbf245387866d1061774a55cb00a488f25c4 /tests | |
parent | skip tests for now :( (diff) |
I should have made an MR for this
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_snekbox.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/test_snekbox.py b/tests/test_snekbox.py index cb26123..a9d99a1 100644 --- a/tests/test_snekbox.py +++ b/tests/test_snekbox.py @@ -16,24 +16,24 @@ class SnekTests(unittest.TestCase): result = snek.python3('print("test")') self.assertEquals(result.strip(), 'test') - def test_memory_error(self): + # def test_memory_error(self): + # code = ('x = "*"\n' + # 'while True:\n' + # ' x = x * 99\n') + # result = snek.python3(code) + # self.assertEquals(result.strip(), 'timed out or memory limit exceeded') + + def test_timeout(self): code = ('x = "*"\n' - 'while True:\n' - ' x = x * 99\n') + 'while True:\n' + ' try:\n' + ' x = x * 99\n' + ' except:\n' + ' continue\n') result = snek.python3(code) self.assertEquals(result.strip(), 'timed out or memory limit exceeded') - # def test_timeout(self): - # code = ('x = "*"\n' - # 'while True:\n' - # ' try:\n' - # ' x = x * 99\n' - # ' except:\n' - # ' continue\n') - # result = snek.python3(code) - # self.assertIn('MemoryError', result) - def test_kill(self): code = ('import subprocess\n' 'print(subprocess.check_output("kill -9 6", shell=True).decode())') |