Debian Codegraph @

tests/key_paths.py

raw
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 """Tests for the key path functions."""
4
5 import unittest
6
7 from dfwinreg import key_paths
8
9 from tests import test_lib
10
11
12 class KeyPathTest(test_lib.BaseTestCase):
13 """Tests for the key path functions."""
14
15 # TODO: add tests for JoinKeyPath
16
17 def testSplitKeyPath(self):
18 """Tests the SplitKeyPath function."""
19 expected_path_segments = ['HKEY_CURRENT_USER', 'Software', 'Microsoft']
20 path_segments = key_paths.SplitKeyPath(
21 'HKEY_CURRENT_USER\\Software\\Microsoft', '\\')
22 self.assertEqual(path_segments, expected_path_segments)
23
24 # TODO: improve test coverage.
25
26
27 if __name__ == '__main__':
28 unittest.main()