test_get_xdg_dir_2, check xdg_dir default to ~/.config
(monkeypatch)
| 234 | |
| 235 | @with_environment |
| 236 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…