diff options
author | 2023-11-05 10:16:18 -0800 | |
---|---|---|
committer | 2023-11-05 10:16:18 -0800 | |
commit | 841b52be9b960e61af0bcc61454eedc893641626 (patch) | |
tree | 635611c04770cffd33036a2a2380f978017ee621 /tests | |
parent | Merge #195 - Python 3.12 (diff) | |
parent | Remove Python 3.13 from image (diff) |
Merge #194 - refactor file structure and nsjail module
Diffstat (limited to 'tests')
-rw-r--r-- | tests/api/__init__.py | 2 | ||||
-rw-r--r-- | tests/limits/__init__.py | 0 | ||||
-rw-r--r-- | tests/limits/test_timed.py (renamed from tests/test_timed.py) | 2 | ||||
-rw-r--r-- | tests/snekio/__init__.py | 0 | ||||
-rw-r--r-- | tests/snekio/test_filesystem.py (renamed from tests/test_filesystem.py) | 2 | ||||
-rw-r--r-- | tests/snekio/test_memfs.py (renamed from tests/test_memfs.py) | 6 | ||||
-rw-r--r-- | tests/snekio/test_snekio.py (renamed from tests/test_snekio.py) | 0 | ||||
-rw-r--r-- | tests/test_nsjail.py | 4 |
8 files changed, 8 insertions, 8 deletions
diff --git a/tests/api/__init__.py b/tests/api/__init__.py index 5f20faf..c84080e 100644 --- a/tests/api/__init__.py +++ b/tests/api/__init__.py @@ -4,7 +4,7 @@ from unittest import mock from falcon import testing from snekbox.api import SnekAPI -from snekbox.process import EvalResult +from snekbox.result import EvalResult class SnekAPITestCase(testing.TestCase): diff --git a/tests/limits/__init__.py b/tests/limits/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/limits/__init__.py diff --git a/tests/test_timed.py b/tests/limits/test_timed.py index e46bd37..8a1119b 100644 --- a/tests/test_timed.py +++ b/tests/limits/test_timed.py @@ -2,7 +2,7 @@ import math import time from unittest import TestCase -from snekbox.utils.timed import time_limit +from snekbox.limits.timed import time_limit class TimedTests(TestCase): diff --git a/tests/snekio/__init__.py b/tests/snekio/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/snekio/__init__.py diff --git a/tests/test_filesystem.py b/tests/snekio/test_filesystem.py index e4d081f..9f6b76d 100644 --- a/tests/test_filesystem.py +++ b/tests/snekio/test_filesystem.py @@ -5,7 +5,7 @@ from tempfile import TemporaryDirectory from unittest import TestCase from uuid import uuid4 -from snekbox.filesystem import UnmountFlags, mount, unmount +from snekbox.snekio.filesystem import UnmountFlags, mount, unmount class LibMountTests(TestCase): diff --git a/tests/test_memfs.py b/tests/snekio/test_memfs.py index 0555726..cbe2fe4 100644 --- a/tests/test_memfs.py +++ b/tests/snekio/test_memfs.py @@ -4,7 +4,7 @@ from contextlib import ExitStack from unittest import TestCase, mock from uuid import uuid4 -from snekbox.memfs import MemFS +from snekbox.snekio import MemFS UUID_TEST = uuid4() @@ -12,10 +12,10 @@ UUID_TEST = uuid4() class MemFSTests(TestCase): def setUp(self): super().setUp() - self.logger = logging.getLogger("snekbox.memfs") + self.logger = logging.getLogger("snekbox.snekio.memfs") self.logger.setLevel(logging.WARNING) - @mock.patch("snekbox.memfs.uuid4", lambda: UUID_TEST) + @mock.patch("snekbox.snekio.memfs.uuid4", lambda: UUID_TEST) def test_assignment_thread_safe(self): """Test concurrent mounting works in multi-thread environments.""" # Concurrently create MemFS in threads, check only 1 can be created diff --git a/tests/test_snekio.py b/tests/snekio/test_snekio.py index 8f04429..8f04429 100644 --- a/tests/test_snekio.py +++ b/tests/snekio/test_snekio.py diff --git a/tests/test_nsjail.py b/tests/test_nsjail.py index 5d927c2..d54d31b 100644 --- a/tests/test_nsjail.py +++ b/tests/test_nsjail.py @@ -9,9 +9,9 @@ from itertools import product from pathlib import Path from textwrap import dedent -from snekbox.filesystem import Size from snekbox.nsjail import NsJail from snekbox.snekio import FileAttachment +from snekbox.snekio.filesystem import Size class NsJailTests(unittest.TestCase): @@ -576,7 +576,7 @@ class NsJailCgroupTests(unittest.TestCase): # This should still pass for v2, even if this test isn't relevant. def test_cgroupv1(self): logging.getLogger("snekbox.nsjail").setLevel(logging.ERROR) - logging.getLogger("snekbox.utils.swap").setLevel(logging.ERROR) + logging.getLogger("snekbox.limits.swap").setLevel(logging.ERROR) config_base = dedent( """ |