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

Function test_get_ipython_cache_dir

IPython/core/tests/test_paths.py:173–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171
172
173def test_get_ipython_cache_dir():
174 with modified_env({'HOME': HOME_TEST_DIR}):
175 if os.name == 'posix' and sys.platform != 'darwin':
176 # test default
177 os.makedirs(os.path.join(HOME_TEST_DIR, ".cache"))
178 with modified_env({'XDG_CACHE_HOME': None}):
179 ipdir = paths.get_ipython_cache_dir()
180 nt.assert_equal(os.path.join(HOME_TEST_DIR, ".cache", "ipython"),
181 ipdir)
182 assert_isdir(ipdir)
183
184 # test env override
185 with modified_env({"XDG_CACHE_HOME": XDG_CACHE_DIR}):
186 ipdir = paths.get_ipython_cache_dir()
187 assert_isdir(ipdir)
188 nt.assert_equal(ipdir, os.path.join(XDG_CACHE_DIR, "ipython"))
189 else:
190 nt.assert_equal(paths.get_ipython_cache_dir(),
191 paths.get_ipython_dir())
192
193def test_get_ipython_package_dir():
194 ipdir = paths.get_ipython_package_dir()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected