'Test to get user config directory under unix'

@unittest.skipIf(sys.platform.startswith('win'), 'this    is    test    for    unix    system')
def test_get_user_cfg_dir_unix(self):

    conf = self.new_config(_utest=True)
    with mock.patch('os.path.expanduser', return_value='/home/foo'):
        with mock.patch('os.path.exists', return_value=True):
            self.assertEqual(conf.GetUserCfgDir(), '/home/foo/.idlerc')
    with mock.patch('os.path.expanduser', return_value='~'):
        with mock.patch('os.getcwd', return_value='/home/foo/cpython'):
            with mock.patch('os.mkdir'):
                self.assertEqual(conf.GetUserCfgDir(), '/home/foo/cpython/.idlerc')
    with mock.patch('os.path.join', return_value='/path/not/exists'):
        with self.assertRaises(SystemExit):
            with self.assertRaises(FileNotFoundError):
                conf.GetUserCfgDir()
