MCPcopy Create free account
hub / github.com/ipython/ipython / test_get_home_dir_8

Function test_get_home_dir_8

IPython/utils/tests/test_path.py:163–184  ·  view source on GitHub ↗

Using registry hack for 'My Documents', os=='nt' HOMESHARE, HOMEDRIVE, HOMEPATH, USERPROFILE and others are missing.

()

Source from the content-addressed store, hash-verified

161@skip_if_not_win32
162@with_environment
163def test_get_home_dir_8():
164 """Using registry hack for 'My Documents', os=='nt'
165
166 HOMESHARE, HOMEDRIVE, HOMEPATH, USERPROFILE and others are missing.
167 """
168 os.name = 'nt'
169 # Remove from stub environment all keys that may be set
170 for key in ['HOME', 'HOMESHARE', 'HOMEDRIVE', 'HOMEPATH', 'USERPROFILE']:
171 env.pop(key, None)
172
173 class key:
174 def __enter__(self):
175 pass
176 def Close(self):
177 pass
178 def __exit__(*args, **kwargs):
179 pass
180
181 with patch.object(wreg, 'OpenKey', return_value=key()), \
182 patch.object(wreg, 'QueryValueEx', return_value=[abspath(HOME_TEST_DIR)]):
183 home_dir = path.get_home_dir()
184 nt.assert_equal(home_dir, abspath(HOME_TEST_DIR))
185
186@with_environment
187def test_get_xdg_dir_0():

Callers

nothing calls this directly

Calls 2

keyClass · 0.85
popMethod · 0.80

Tested by

no test coverage detected