summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/smb/tests
diff options
context:
space:
mode:
authorJohn Mulligan <jmulligan@redhat.com>2024-01-30 20:33:29 +0100
committerJohn Mulligan <jmulligan@redhat.com>2024-04-26 01:10:39 +0200
commit3808051c1b1af56033d73ba117bf73f4ed3542fb (patch)
treee607dfeeb2b4d1e07ba9e683780aa00b5fe1ba19 /src/pybind/mgr/smb/tests
parentpybind/mgr/smb: create a smb tests dir (diff)
downloadceph-3808051c1b1af56033d73ba117bf73f4ed3542fb.tar.xz
ceph-3808051c1b1af56033d73ba117bf73f4ed3542fb.zip
pybind/mgr/smb: add unit tests file tests/test_enums.py
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Diffstat (limited to 'src/pybind/mgr/smb/tests')
-rw-r--r--src/pybind/mgr/smb/tests/test_enums.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pybind/mgr/smb/tests/test_enums.py b/src/pybind/mgr/smb/tests/test_enums.py
new file mode 100644
index 00000000000..f3f0f4eeb8b
--- /dev/null
+++ b/src/pybind/mgr/smb/tests/test_enums.py
@@ -0,0 +1,26 @@
+import pytest
+
+import smb.enums
+
+
+@pytest.mark.parametrize(
+ "value, strval",
+ [
+ (smb.enums.CephFSStorageProvider.KERNEL_MOUNT, "kcephfs"),
+ (smb.enums.CephFSStorageProvider.SAMBA_VFS, "samba-vfs"),
+ (smb.enums.SubSystem.CEPHFS, "cephfs"),
+ (smb.enums.Intent.PRESENT, "present"),
+ (smb.enums.Intent.REMOVED, "removed"),
+ (smb.enums.State.CREATED, "created"),
+ (smb.enums.State.NOT_PRESENT, "not present"),
+ (smb.enums.State.PRESENT, "present"),
+ (smb.enums.State.REMOVED, "removed"),
+ (smb.enums.State.UPDATED, "updated"),
+ (smb.enums.AuthMode.USER, "user"),
+ (smb.enums.AuthMode.ACTIVE_DIRECTORY, "active-directory"),
+ (smb.enums.JoinSourceType.PASSWORD, "password"),
+ (smb.enums.UserGroupSourceType.INLINE, "inline"),
+ ],
+)
+def test_stringified(value, strval):
+ assert str(value) == strval