test_get_xdg_dir_2, check xdg_dir default to ~/.config
()
| 212 | |
| 213 | @with_environment |
| 214 | def test_get_xdg_dir_2(): |
| 215 | """test_get_xdg_dir_2, check xdg_dir default to ~/.config""" |
| 216 | reload(path) |
| 217 | path.get_home_dir = lambda : HOME_TEST_DIR |
| 218 | os.name = "posix" |
| 219 | sys.platform = "linux2" |
| 220 | env.pop('IPYTHON_DIR', None) |
| 221 | env.pop('IPYTHONDIR', None) |
| 222 | env.pop('XDG_CONFIG_HOME', None) |
| 223 | cfgdir=os.path.join(path.get_home_dir(), '.config') |
| 224 | if not os.path.exists(cfgdir): |
| 225 | os.makedirs(cfgdir) |
| 226 | |
| 227 | nt.assert_equal(path.get_xdg_dir(), cfgdir) |
| 228 | |
| 229 | @with_environment |
| 230 | def test_get_xdg_dir_3(): |