test_get_ipython_dir_3, move XDG if defined, and .ipython doesn't exist.
()
| 69 | nt.assert_equal(ipdir, os.path.join("someplace", ".ipython")) |
| 70 | |
| 71 | def test_get_ipython_dir_3(): |
| 72 | """test_get_ipython_dir_3, move XDG if defined, and .ipython doesn't exist.""" |
| 73 | tmphome = TemporaryDirectory() |
| 74 | try: |
| 75 | with patch_get_home_dir(tmphome.name), \ |
| 76 | patch('os.name', 'posix'), \ |
| 77 | modified_env({ |
| 78 | 'IPYTHON_DIR': None, |
| 79 | 'IPYTHONDIR': None, |
| 80 | 'XDG_CONFIG_HOME': XDG_TEST_DIR, |
| 81 | }), warnings.catch_warnings(record=True) as w: |
| 82 | ipdir = paths.get_ipython_dir() |
| 83 | |
| 84 | nt.assert_equal(ipdir, os.path.join(tmphome.name, ".ipython")) |
| 85 | if sys.platform != 'darwin': |
| 86 | nt.assert_equal(len(w), 1) |
| 87 | nt.assert_in('Moving', str(w[0])) |
| 88 | finally: |
| 89 | tmphome.cleanup() |
| 90 | |
| 91 | def test_get_ipython_dir_4(): |
| 92 | """test_get_ipython_dir_4, warn if XDG and home both exist.""" |
nothing calls this directly
no test coverage detected