MCPcopy Index your code
hub / github.com/ipython/ipython / test_get_xdg_dir_2

Function test_get_xdg_dir_2

tests/test_path.py:236–248  ·  view source on GitHub ↗

test_get_xdg_dir_2, check xdg_dir default to ~/.config

(monkeypatch)

Source from the content-addressed store, hash-verified

234
235@with_environment
236def test_get_xdg_dir_2(monkeypatch):
237 """test_get_xdg_dir_2, check xdg_dir default to ~/.config"""
238 monkeypatch.setattr(path, "get_home_dir", lambda: HOME_TEST_DIR)
239 monkeypatch.setattr(os, "name", "posix")
240 monkeypatch.setattr(sys, "platform", "linux2")
241 env.pop("IPYTHON_DIR", None)
242 env.pop("IPYTHONDIR", None)
243 env.pop("XDG_CONFIG_HOME", None)
244 cfgdir = os.path.join(path.get_home_dir(), ".config")
245 if not os.path.exists(cfgdir):
246 os.makedirs(cfgdir)
247
248 assert path.get_xdg_dir() == cfgdir
249
250
251@with_environment

Callers

nothing calls this directly

Calls 1

popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…