diff options
author | 2022-11-20 21:34:54 -0500 | |
---|---|---|
committer | 2022-11-20 21:34:54 -0500 | |
commit | 69ff6809331bcf6097a71c6f7b1087fe344c8797 (patch) | |
tree | 468718291881d63a6284181ed23a03741320399c /tests/test_nsjail.py | |
parent | Add unit test for multiple python files (diff) |
Combined file handling to FileAttachment class
Diffstat (limited to 'tests/test_nsjail.py')
-rw-r--r-- | tests/test_nsjail.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index c61e2e5..ba6cac7 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -10,7 +10,7 @@ from pathlib import Path from textwrap import dedent from snekbox.nsjail import NsJail -from snekbox.snekio import EvalRequestFile +from snekbox.snekio import FileAttachment class NsJailTests(unittest.TestCase): @@ -25,7 +25,7 @@ class NsJailTests(unittest.TestCase): return self.nsjail.python3(["-c", code]) def eval_file(self, code: str, name: str = "test.py"): - file = EvalRequestFile(name, code) + file = FileAttachment(name, code) return self.nsjail.python3([name], [file]) def test_print_returns_0(self): @@ -58,8 +58,8 @@ class NsJailTests(unittest.TestCase): def test_multi_files(self): files = [ - EvalRequestFile("main.py", "import lib; print(lib.x)"), - EvalRequestFile("lib.py", "x = 'hello'"), + FileAttachment("main.py", "import lib; print(lib.x)"), + FileAttachment("lib.py", "x = 'hello'"), ] result = self.nsjail.python3(["main.py"], files) |