trustcafe-api-wrapper/tests/utils/get_parent_pksk_from_path.py
simonwt fb1953e953 Test the utils
Comment create wrapper
Test comment wrapper
2026-04-01 23:00:42 +01:00

15 lines
No EOL
647 B
Python

import unittest
from utils.get_parent_pksk_from_path import get_parent_pksk_from_path
class TestGetParentPkskFromPath(unittest.TestCase):
def test_root_path(self):
self.assertEqual(get_parent_pksk_from_path('/'), 'maintrunk#maintrunk')
def test_userprofile_path(self):
self.assertEqual(get_parent_pksk_from_path('/user/johndoe'), 'userprofile#johndoe')
def test_subwiki_path(self):
self.assertEqual(get_parent_pksk_from_path('/branch/12345'), 'subwiki#12345')
def test_invalid_entity(self):
with self.assertRaises(ValueError):
get_parent_pksk_from_path('/invalid/12345')