()
| 171 | |
| 172 | |
| 173 | def 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 | |
| 193 | def test_get_ipython_package_dir(): |
| 194 | ipdir = paths.get_ipython_package_dir() |
nothing calls this directly
no outgoing calls
no test coverage detected