def test_registry_write(): k1 = "Software\\MockedApplicationName1" k2 = "Software\\MockedApplicationName2" values = {"a": "foo", "b": "42"} try: assert registry.write(k1, "bar") assert registry.write(k2, values) assert not registry.read(f"{k1}\\unknown") assert registry.read(k2) == values finally: assert registry.delete(k1) assert registry.delete(k2)
def test_registry_create(): k = f"Software\\Classes\\directory\\shell\\MockedApplicationName" try: registry.create(k) assert registry.exists(k) finally: assert registry.delete(k)
def test_registry_read(): k = "Software\\MockedApplicationName" assert not registry.read(k) assert registry.delete(k)
def test_registry_delete(): k = f"Software\\Classes\\directory\\shell\\MockedApplicationNameUnknown" assert registry.delete(k)