| 1 |
#!/usr/bin/env python3 |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
"""Tests for the fake Windows Registry back-end.""" |
| 4 |
|
| 5 |
import unittest |
| 6 |
|
| 7 |
from dfwinreg import definitions |
| 8 |
from dfwinreg import errors |
| 9 |
from dfwinreg import fake |
| 10 |
|
| 11 |
from tests import test_lib |
| 12 |
|
| 13 |
|
| 14 |
class FakeWinRegTestCase(test_lib.BaseTestCase): |
| 15 |
"""The unit test case for fake Windows Registry related.""" |
| 16 |
|
| 17 |
def _OpenFakeRegistryFile(self, key_path_prefix=''): |
| 18 |
"""Opens a fake Windows Registry file. |
| 19 |
|
| 20 |
Args: |
| 21 |
key_path_prefix (str): Windows Registry key path prefix. |
| 22 |
|
| 23 |
Returns: |
| 24 |
FakeWinRegistryFileTest: fake Windows Registry file. |
| 25 |
""" |
| 26 |
registry_file = fake.FakeWinRegistryFile( |
| 27 |
key_path_prefix=key_path_prefix) |
| 28 |
|
| 29 |
software_key = fake.FakeWinRegistryKey('Software') |
| 30 |
registry_file.AddKeyByPath('\\', software_key) |
| 31 |
|
| 32 |
registry_file.Open(None) |
| 33 |
return registry_file |
| 34 |
|
| 35 |
|
| 36 |
class FakeWinRegistryFileTest(FakeWinRegTestCase): |
| 37 |
"""Tests for a fake Windows Registry file.""" |
| 38 |
|
| 39 |
def testAddKeyByPath(self): |
| 40 |
"""Tests the AddKeyByPath function.""" |
| 41 |
registry_file = fake.FakeWinRegistryFile() |
| 42 |
|
| 43 |
software_key = fake.FakeWinRegistryKey('Software') |
| 44 |
registry_file.AddKeyByPath('\\', software_key) |
| 45 |
|
| 46 |
test_key = fake.FakeWinRegistryKey('Key') |
| 47 |
registry_file.AddKeyByPath('\\Test\\Path', test_key) |
| 48 |
|
| 49 |
test_key = fake.FakeWinRegistryKey('More') |
| 50 |
registry_file.AddKeyByPath('\\Test\\Path\\Key', test_key) |
| 51 |
|
| 52 |
with self.assertRaises(KeyError): |
| 53 |
registry_file.AddKeyByPath('\\', software_key) |
| 54 |
|
| 55 |
with self.assertRaises(ValueError): |
| 56 |
registry_file.AddKeyByPath('Test', software_key) |
| 57 |
|
| 58 |
def testOpenClose(self): |
| 59 |
"""Tests the Open and Close functions.""" |
| 60 |
registry_file = self._OpenFakeRegistryFile() |
| 61 |
registry_file.Close() |
| 62 |
|
| 63 |
def testGetKeyByPath(self): |
| 64 |
"""Tests the GetKeyByPath function.""" |
| 65 |
registry_file = fake.FakeWinRegistryFile() |
| 66 |
|
| 67 |
registry_key = registry_file.GetKeyByPath('\\') |
| 68 |
self.assertIsNone(registry_key) |
| 69 |
|
| 70 |
registry_file = self._OpenFakeRegistryFile( |
| 71 |
key_path_prefix='HKEY_LOCAL_MACHINE') |
| 72 |
|
| 73 |
test_key = fake.FakeWinRegistryKey('Key') |
| 74 |
registry_file.AddKeyByPath('\\Test\\Path', test_key) |
| 75 |
|
| 76 |
# Test root key without prefix. |
| 77 |
key_path = '\\' |
| 78 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 79 |
self.assertIsNotNone(registry_key) |
| 80 |
self.assertEqual(registry_key.path, key_path) |
| 81 |
|
| 82 |
# Test root key with prefix. |
| 83 |
key_path = 'HKEY_LOCAL_MACHINE\\' |
| 84 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 85 |
self.assertIsNotNone(registry_key) |
| 86 |
self.assertEqual(registry_key.path, '\\') |
| 87 |
|
| 88 |
# Test key without prefix. |
| 89 |
key_path = '\\Software' |
| 90 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 91 |
self.assertIsNotNone(registry_key) |
| 92 |
self.assertEqual(registry_key.path, key_path) |
| 93 |
|
| 94 |
# Test key with prefix. |
| 95 |
key_path = 'HKEY_LOCAL_MACHINE\\Software' |
| 96 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 97 |
self.assertIsNotNone(registry_key) |
| 98 |
self.assertEqual(registry_key.path, '\\Software') |
| 99 |
|
| 100 |
# Test key with some depth. |
| 101 |
key_path = '\\Test\\Path\\Key' |
| 102 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 103 |
self.assertIsNotNone(registry_key) |
| 104 |
self.assertEqual(registry_key.path, key_path) |
| 105 |
|
| 106 |
# Test non-existing keys. |
| 107 |
key_path = '\\Bogus' |
| 108 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 109 |
self.assertIsNone(registry_key) |
| 110 |
|
| 111 |
key_path = '\\Test\\Path\\Bogus' |
| 112 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 113 |
self.assertIsNone(registry_key) |
| 114 |
|
| 115 |
key_path = 'Bogus' |
| 116 |
registry_key = registry_file.GetKeyByPath(key_path) |
| 117 |
self.assertIsNone(registry_key) |
| 118 |
|
| 119 |
registry_file.Close() |
| 120 |
|
| 121 |
def testGetRootKey(self): |
| 122 |
"""Tests the GetRootKey function.""" |
| 123 |
registry_file = self._OpenFakeRegistryFile() |
| 124 |
|
| 125 |
registry_key = registry_file.GetRootKey() |
| 126 |
self.assertIsNotNone(registry_key) |
| 127 |
self.assertEqual(registry_key.path, '\\') |
| 128 |
|
| 129 |
registry_file.Close() |
| 130 |
|
| 131 |
def testRecurseKeys(self): |
| 132 |
"""Tests the RecurseKeys function.""" |
| 133 |
registry_file = self._OpenFakeRegistryFile() |
| 134 |
|
| 135 |
registry_keys = list(registry_file.RecurseKeys()) |
| 136 |
registry_file.Close() |
| 137 |
|
| 138 |
self.assertEqual(len(registry_keys), 2) |
| 139 |
|
| 140 |
|
| 141 |
class FakeWinRegistryKeyTest(test_lib.BaseTestCase): |
| 142 |
"""Tests for a fake Windows Registry key.""" |
| 143 |
|
| 144 |
# pylint: disable=protected-access |
| 145 |
|
| 146 |
_KEY_PATH_PREFIX = 'HKEY_CURRENT_USER\\Software' |
| 147 |
|
| 148 |
def _CreateTestKey(self): |
| 149 |
"""Creates a fake Windows Registry key for testing. |
| 150 |
|
| 151 |
Returns: |
| 152 |
FakeWinRegistryKey: fake Windows Registry key. |
| 153 |
""" |
| 154 |
registry_key = fake.FakeWinRegistryKey( |
| 155 |
'Software', key_path_prefix=self._KEY_PATH_PREFIX, |
| 156 |
last_written_time=0, relative_key_path='') |
| 157 |
|
| 158 |
sub_registry_key = fake.FakeWinRegistryKey( |
| 159 |
'Microsoft', last_written_time=0) |
| 160 |
registry_key.AddSubkey(sub_registry_key.name, sub_registry_key) |
| 161 |
|
| 162 |
test_registry_key = fake.FakeWinRegistryKey( |
| 163 |
'Internet Explorer', last_written_time=0) |
| 164 |
sub_registry_key.AddSubkey(test_registry_key.name, test_registry_key) |
| 165 |
|
| 166 |
registry_value = fake.FakeWinRegistryValue('') |
| 167 |
registry_key.AddValue(registry_value) |
| 168 |
|
| 169 |
return registry_key |
| 170 |
|
| 171 |
def testProperties(self): |
| 172 |
"""Tests the properties.""" |
| 173 |
registry_key = self._CreateTestKey() |
| 174 |
self.assertIsNotNone(registry_key) |
| 175 |
|
| 176 |
self.assertIsNone(registry_key.class_name) |
| 177 |
self.assertIsNotNone(registry_key.last_written_time) |
| 178 |
self.assertEqual(registry_key.last_written_time.timestamp, 0) |
| 179 |
|
| 180 |
self.assertEqual(registry_key.number_of_subkeys, 1) |
| 181 |
self.assertEqual(registry_key.number_of_values, 1) |
| 182 |
self.assertIsNone(registry_key.offset) |
| 183 |
|
| 184 |
registry_key._last_written_time = None |
| 185 |
self.assertIsNotNone(registry_key.last_written_time) |
| 186 |
|
| 187 |
date_time_string = registry_key.last_written_time.CopyToDateTimeString() |
| 188 |
self.assertEqual(date_time_string, 'Not set') |
| 189 |
|
| 190 |
def testBuildKeyHierarchy(self): |
| 191 |
"""Tests the BuildKeyHierarchy function.""" |
| 192 |
test_key = fake.FakeWinRegistryKey( |
| 193 |
'Microsoft', key_path_prefix=self._KEY_PATH_PREFIX, |
| 194 |
last_written_time=0, relative_key_path='Microsoft') |
| 195 |
|
| 196 |
test_value = fake.FakeWinRegistryValue('') |
| 197 |
|
| 198 |
self.assertIsNotNone(test_key) |
| 199 |
self.assertIsNotNone(test_value) |
| 200 |
|
| 201 |
# Test with subkeys and values. |
| 202 |
registry_key = fake.FakeWinRegistryKey( |
| 203 |
'Software', key_path_prefix=self._KEY_PATH_PREFIX, |
| 204 |
last_written_time=0, relative_key_path='', |
| 205 |
subkeys=[test_key], values=[test_value]) |
| 206 |
self.assertIsNotNone(registry_key) |
| 207 |
|
| 208 |
# Test with duplicate subkeys and values. |
| 209 |
registry_key = fake.FakeWinRegistryKey( |
| 210 |
'Software', key_path_prefix=self._KEY_PATH_PREFIX, |
| 211 |
last_written_time=0, relative_key_path='', |
| 212 |
subkeys=[test_key, test_key], |
| 213 |
values=[test_value, test_value]) |
| 214 |
self.assertIsNotNone(registry_key) |
| 215 |
|
| 216 |
def testAddSubkey(self): |
| 217 |
"""Tests the AddSubkey function.""" |
| 218 |
registry_key = fake.FakeWinRegistryKey( |
| 219 |
'Software', key_path_prefix=self._KEY_PATH_PREFIX, |
| 220 |
last_written_time=0, relative_key_path='') |
| 221 |
|
| 222 |
sub_registry_key = fake.FakeWinRegistryKey( |
| 223 |
'Microsoft', key_path_prefix=self._KEY_PATH_PREFIX, |
| 224 |
last_written_time=0, relative_key_path='Microsoft') |
| 225 |
|
| 226 |
registry_key.AddSubkey(sub_registry_key.name, sub_registry_key) |
| 227 |
|
| 228 |
with self.assertRaises(KeyError): |
| 229 |
registry_key.AddSubkey(sub_registry_key.name, sub_registry_key) |
| 230 |
|
| 231 |
def testAddValue(self): |
| 232 |
"""Tests the AddValue function.""" |
| 233 |
registry_key = fake.FakeWinRegistryKey( |
| 234 |
'Software', key_path_prefix=self._KEY_PATH_PREFIX, |
| 235 |
last_written_time=0, relative_key_path='') |
| 236 |
|
| 237 |
registry_value = fake.FakeWinRegistryValue('') |
| 238 |
|
| 239 |
registry_key.AddValue(registry_value) |
| 240 |
|
| 241 |
with self.assertRaises(KeyError): |
| 242 |
registry_key.AddValue(registry_value) |
| 243 |
|
| 244 |
def testGetSubkeyByIndex(self): |
| 245 |
"""Tests the GetSubkeyByIndex function.""" |
| 246 |
registry_key = self._CreateTestKey() |
| 247 |
|
| 248 |
sub_registry_key = registry_key.GetSubkeyByIndex(0) |
| 249 |
self.assertIsNotNone(sub_registry_key) |
| 250 |
|
| 251 |
expected_key_path = 'HKEY_CURRENT_USER\\Software\\Microsoft' |
| 252 |
self.assertEqual(sub_registry_key.path, expected_key_path) |
| 253 |
|
| 254 |
with self.assertRaises(IndexError): |
| 255 |
registry_key.GetSubkeyByIndex(-1) |
| 256 |
|
| 257 |
def testGetSubkeyByName(self): |
| 258 |
"""Tests the GetSubkeyByName function.""" |
| 259 |
registry_key = self._CreateTestKey() |
| 260 |
|
| 261 |
sub_registry_key = registry_key.GetSubkeyByName('Microsoft') |
| 262 |
self.assertIsNotNone(sub_registry_key) |
| 263 |
|
| 264 |
expected_key_path = 'HKEY_CURRENT_USER\\Software\\Microsoft' |
| 265 |
self.assertEqual(sub_registry_key.path, expected_key_path) |
| 266 |
|
| 267 |
sub_registry_key = registry_key.GetSubkeyByName('Bogus') |
| 268 |
self.assertIsNone(sub_registry_key) |
| 269 |
|
| 270 |
def testGetSubkeyByPath(self): |
| 271 |
"""Tests the GetSubkeyByPath function.""" |
| 272 |
registry_key = self._CreateTestKey() |
| 273 |
|
| 274 |
key_path = 'Microsoft\\Internet Explorer' |
| 275 |
sub_registry_key = registry_key.GetSubkeyByPath(key_path) |
| 276 |
self.assertIsNotNone(sub_registry_key) |
| 277 |
self.assertEqual(sub_registry_key.name, 'Internet Explorer') |
| 278 |
|
| 279 |
expected_key_path = ( |
| 280 |
'HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer') |
| 281 |
self.assertEqual(sub_registry_key.path, expected_key_path) |
| 282 |
|
| 283 |
key_path = 'Microsoft\\Bogus' |
| 284 |
sub_registry_key = registry_key.GetSubkeyByPath(key_path) |
| 285 |
self.assertIsNone(sub_registry_key) |
| 286 |
|
| 287 |
def testGetSubkeys(self): |
| 288 |
"""Tests the GetSubkeys function.""" |
| 289 |
registry_key = self._CreateTestKey() |
| 290 |
|
| 291 |
sub_registry_keys = list(registry_key.GetSubkeys()) |
| 292 |
self.assertEqual(len(sub_registry_keys), 1) |
| 293 |
|
| 294 |
def testGetValueByName(self): |
| 295 |
"""Tests the GetValueByName function.""" |
| 296 |
registry_key = self._CreateTestKey() |
| 297 |
|
| 298 |
registry_value = registry_key.GetValueByName('') |
| 299 |
self.assertIsNotNone(registry_value) |
| 300 |
|
| 301 |
registry_value = registry_key.GetValueByName('Bogus') |
| 302 |
self.assertIsNone(registry_value) |
| 303 |
|
| 304 |
def testGetValues(self): |
| 305 |
"""Tests the GetValues function.""" |
| 306 |
registry_key = self._CreateTestKey() |
| 307 |
|
| 308 |
values = list(registry_key.GetValues()) |
| 309 |
self.assertEqual(len(values), 1) |
| 310 |
|
| 311 |
|
| 312 |
class FakeWinRegistryValueTest(test_lib.BaseTestCase): |
| 313 |
"""Tests for a fake Windows Registry value.""" |
| 314 |
|
| 315 |
def testProperties(self): |
| 316 |
"""Tests the properties.""" |
| 317 |
registry_value = fake.FakeWinRegistryValue( |
| 318 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 319 |
self.assertIsNotNone(registry_value) |
| 320 |
|
| 321 |
self.assertEqual(registry_value.data, b'') |
| 322 |
self.assertEqual(registry_value.data_type, definitions.REG_BINARY) |
| 323 |
self.assertEqual(registry_value.name, 'MRUListEx') |
| 324 |
self.assertEqual(registry_value.offset, 0) |
| 325 |
|
| 326 |
def testGetDataAsObject(self): |
| 327 |
"""Tests the GetDataAsObject function.""" |
| 328 |
registry_value = fake.FakeWinRegistryValue( |
| 329 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 330 |
|
| 331 |
value_data = registry_value.GetDataAsObject() |
| 332 |
self.assertIsNone(value_data) |
| 333 |
|
| 334 |
registry_value = fake.FakeWinRegistryValue( |
| 335 |
'MRUListEx', data=b'DATA', data_type=definitions.REG_BINARY) |
| 336 |
|
| 337 |
value_data = registry_value.GetDataAsObject() |
| 338 |
self.assertEqual(value_data, b'DATA') |
| 339 |
|
| 340 |
data = 'ValueData'.encode('utf-16-le') |
| 341 |
registry_value = fake.FakeWinRegistryValue( |
| 342 |
'MRU', data=data, data_type=definitions.REG_SZ) |
| 343 |
|
| 344 |
value_data = registry_value.GetDataAsObject() |
| 345 |
self.assertEqual(value_data, 'ValueData') |
| 346 |
|
| 347 |
data = '\xed\x44' |
| 348 |
registry_value = fake.FakeWinRegistryValue( |
| 349 |
'MRU', data=data, data_type=definitions.REG_SZ) |
| 350 |
|
| 351 |
with self.assertRaises(errors.WinRegistryValueError): |
| 352 |
registry_value.GetDataAsObject() |
| 353 |
|
| 354 |
registry_value = fake.FakeWinRegistryValue( |
| 355 |
'Count', data=b'\x11\x22\x33\x44', data_type=definitions.REG_DWORD) |
| 356 |
|
| 357 |
value_data = registry_value.GetDataAsObject() |
| 358 |
self.assertEqual(value_data, 0x44332211) |
| 359 |
|
| 360 |
registry_value = fake.FakeWinRegistryValue( |
| 361 |
'Count', data=b'\x11\x22\x33\x44', |
| 362 |
data_type=definitions.REG_DWORD_BIG_ENDIAN) |
| 363 |
|
| 364 |
value_data = registry_value.GetDataAsObject() |
| 365 |
self.assertEqual(value_data, 0x11223344) |
| 366 |
|
| 367 |
registry_value = fake.FakeWinRegistryValue( |
| 368 |
'Count', data=b'\x88\x77\x66\x55\x44\x33\x22\x11', |
| 369 |
data_type=definitions.REG_QWORD) |
| 370 |
|
| 371 |
value_data = registry_value.GetDataAsObject() |
| 372 |
self.assertEqual(value_data, 0x1122334455667788) |
| 373 |
|
| 374 |
# Test REG_MULTI_SZ without additional empty string. |
| 375 |
data = b'\x65\x00\x6e\x00\x2d\x00\x55\x00\x53\x00\x00\x00' |
| 376 |
registry_value = fake.FakeWinRegistryValue( |
| 377 |
'MRU', data=data, data_type=definitions.REG_MULTI_SZ) |
| 378 |
|
| 379 |
value_data = registry_value.GetDataAsObject() |
| 380 |
self.assertEqual(value_data, ['en-US']) |
| 381 |
|
| 382 |
# Test REG_MULTI_SZ with additional empty string. |
| 383 |
data = ( |
| 384 |
b'\x2e\x00\x62\x00\x6d\x00\x70\x00\x00\x00\x2e\x00\x63\x00\x6f\x00' |
| 385 |
b'\x6e\x00\x74\x00\x61\x00\x63\x00\x74\x00\x00\x00\x2e\x00\x6a\x00' |
| 386 |
b'\x6e\x00\x74\x00\x00\x00\x2e\x00\x6c\x00\x69\x00\x62\x00\x72\x00' |
| 387 |
b'\x61\x00\x72\x00\x79\x00\x2d\x00\x6d\x00\x73\x00\x00\x00\x2e\x00' |
| 388 |
b'\x6c\x00\x6e\x00\x6b\x00\x00\x00\x2e\x00\x72\x00\x74\x00\x66\x00' |
| 389 |
b'\x00\x00\x2e\x00\x74\x00\x78\x00\x74\x00\x00\x00\x2e\x00\x7a\x00' |
| 390 |
b'\x69\x00\x70\x00\x00\x00\x46\x00\x6f\x00\x6c\x00\x64\x00\x65\x00' |
| 391 |
b'\x72\x00\x00\x00\x00\x00') |
| 392 |
registry_value = fake.FakeWinRegistryValue( |
| 393 |
'MRU', data=data, data_type=definitions.REG_MULTI_SZ) |
| 394 |
|
| 395 |
expected_value_data = [ |
| 396 |
'.bmp', '.contact', '.jnt', '.library-ms', '.lnk', '.rtf', '.txt', |
| 397 |
'.zip', 'Folder'] |
| 398 |
|
| 399 |
value_data = registry_value.GetDataAsObject() |
| 400 |
self.assertEqual(value_data, expected_value_data) |
| 401 |
|
| 402 |
data = '\xed\x44' |
| 403 |
registry_value = fake.FakeWinRegistryValue( |
| 404 |
'MRU', data=data, data_type=definitions.REG_MULTI_SZ) |
| 405 |
|
| 406 |
with self.assertRaises(errors.WinRegistryValueError): |
| 407 |
registry_value.GetDataAsObject() |
| 408 |
|
| 409 |
registry_value = fake.FakeWinRegistryValue( |
| 410 |
'MRU', data=('bogus', 0), data_type=definitions.REG_SZ) |
| 411 |
|
| 412 |
with self.assertRaises(errors.WinRegistryValueError): |
| 413 |
registry_value.GetDataAsObject() |
| 414 |
|
| 415 |
registry_value = fake.FakeWinRegistryValue( |
| 416 |
'MRU', data=('bogus', 0), data_type=definitions.REG_MULTI_SZ) |
| 417 |
|
| 418 |
with self.assertRaises(errors.WinRegistryValueError): |
| 419 |
registry_value.GetDataAsObject() |
| 420 |
|
| 421 |
def testDataIsBinaryData(self): |
| 422 |
"""Tests the DataIsBinaryData function.""" |
| 423 |
registry_value = fake.FakeWinRegistryValue( |
| 424 |
'Count', data_type=definitions.REG_DWORD) |
| 425 |
|
| 426 |
self.assertFalse(registry_value.DataIsBinaryData()) |
| 427 |
|
| 428 |
registry_value = fake.FakeWinRegistryValue( |
| 429 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 430 |
|
| 431 |
self.assertTrue(registry_value.DataIsBinaryData()) |
| 432 |
|
| 433 |
def testDataIsInteger(self): |
| 434 |
"""Tests the DataIsInteger function.""" |
| 435 |
registry_value = fake.FakeWinRegistryValue( |
| 436 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 437 |
|
| 438 |
self.assertFalse(registry_value.DataIsInteger()) |
| 439 |
|
| 440 |
registry_value = fake.FakeWinRegistryValue( |
| 441 |
'Count', data_type=definitions.REG_DWORD) |
| 442 |
|
| 443 |
self.assertTrue(registry_value.DataIsInteger()) |
| 444 |
|
| 445 |
def testDataIsMultiString(self): |
| 446 |
"""Tests the DataIsMultiString function.""" |
| 447 |
registry_value = fake.FakeWinRegistryValue( |
| 448 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 449 |
|
| 450 |
self.assertFalse(registry_value.DataIsMultiString()) |
| 451 |
|
| 452 |
registry_value = fake.FakeWinRegistryValue( |
| 453 |
'MRU', data_type=definitions.REG_MULTI_SZ) |
| 454 |
|
| 455 |
self.assertTrue(registry_value.DataIsMultiString()) |
| 456 |
|
| 457 |
def testDataIsString(self): |
| 458 |
"""Tests the DataIsString function.""" |
| 459 |
registry_value = fake.FakeWinRegistryValue( |
| 460 |
'MRUListEx', data_type=definitions.REG_BINARY) |
| 461 |
|
| 462 |
self.assertFalse(registry_value.DataIsString()) |
| 463 |
|
| 464 |
registry_value = fake.FakeWinRegistryValue( |
| 465 |
'MRU', data_type=definitions.REG_SZ) |
| 466 |
|
| 467 |
self.assertTrue(registry_value.DataIsString()) |
| 468 |
|
| 469 |
|
| 470 |
if __name__ == '__main__': |
| 471 |
unittest.main() |