summaryrefslogtreecommitdiff
path: root/tests/test_simple.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_simple.py')
-rw-r--r--tests/test_simple.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_simple.py b/tests/test_simple.py
index cb654aa..960bf02 100644
--- a/tests/test_simple.py
+++ b/tests/test_simple.py
@@ -12,6 +12,24 @@ import pytest
import linuxnamespaces
+class MountFlagsTest(unittest.TestCase):
+ def test_tostrfromstr(self) -> None:
+ for bit1 in range(32):
+ for bit2 in range(bit1, 32):
+ flag = (
+ linuxnamespaces.MountFlags(1 << bit1)
+ | linuxnamespaces.MountFlags(1 << bit2)
+ )
+ try:
+ text = flag.tostr()
+ except ValueError:
+ continue
+ self.assertEqual(
+ linuxnamespaces.MountFlags.fromstr(text),
+ flag
+ )
+
+
class IDAllocationTest(unittest.TestCase):
def test_idalloc(self) -> None:
alloc = linuxnamespaces.IDAllocation()