File: key_paths.py

package info (click to toggle)
dfwinreg 20190122-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,820 kB
  • sloc: python: 2,586; sh: 121; makefile: 38
file content (30 lines) | stat: -rw-r--r-- 720 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the key path functions."""

from __future__ import unicode_literals

import unittest

from dfwinreg import key_paths

from tests import test_lib


class KeyPathTest(test_lib.BaseTestCase):
  """Tests for the key path functions."""

  # TODO: add tests for JoinKeyPath

  def testSplitKeyPath(self):
    """Tests the SplitKeyPath function."""
    expected_path_segments = ['HKEY_CURRENT_USER', 'Software', 'Microsoft']
    path_segments = key_paths.SplitKeyPath(
        'HKEY_CURRENT_USER\\Software\\Microsoft', '\\')
    self.assertEqual(path_segments, expected_path_segments)

    # TODO: improve test coverage.


if __name__ == '__main__':
  unittest.main()