'Test to get user config directory under windows'

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

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