<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
2a%                 @   sJ  d dl mZ d dlZd dlZd dlZd dlmZmZ d dlZd dlm	Z	 d dl Z d dl
mZ ejZejZi Zejd Zed< ejd Zed< ejd Zed	< ejd Zed
< dd Zdd ZG dd dejZG dd dejZG dd dejZG dd dejZG dd dejZG dd dejZedkrFejdd dS )    )configN)captured_stderrfindfile)mock)Func main	highlightkeys
extensionsc               C   s   t t_dt_d S )NT)testcfgidleConfuserCfgidlelibtesting r   r   0/opt/alt/python36/lib64/python3.6/test_config.pysetUpModule   s    r   c               C   s   t t_dt_d S )NF)usercfgr   r   r   r   r   r   r   r   tearDownModule!   s    r   c               @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )IdleConfParserTestz
        [one]
        one = false
        two = true
        three = 10

        [two]
        one = a string
        two = true
        three = false
    c             C   s   t jd}|j| j  | j}| j|jddddd | j|jddddd ||jddd	dd
 ||jddd | j|jddddd | j|jddddd ||jddd ||jddd | j|jdd ||jddddd d S )Nr   onebool)typeFtwoTthreeint
   za stringtruefalsenotZexistZDEFAULT)default)r   IdleConfParserread_stringassertEqualZassertIsGetZassertIsNone)selfparsereqr   r   r   test_get5   s    
zIdleConfParserTest.test_getc             C   s\   t jd}|j| j  |j}| j|ddddg | j|ddddg | j|dg  d S )Nr   r   r   r   z	not exist)r   r"   r#   GetOptionListassertCountEqualr$   )r&   r'   Zget_listr   r   r   test_get_option_listJ   s    
z'IdleConfParserTest.test_get_option_listc             C   s&   t jd}|j  | j|j g  d S )Nr   )r   r"   Loadr$   sections)r&   r'   r   r   r   test_load_nothingR   s    
z$IdleConfParserTest.test_load_nothingc             C   sF   t d}tj|}|j  | j|jddd | j|jddg d S )Nzcfgparser.1zFoo Barfoonewbar)r   r   r"   r-   r$   r%   r*   )r&   config_pathr'   r   r   r   test_load_fileW   s
    
z!IdleConfParserTest.test_load_fileN)__name__
__module____qualname__r   r)   r,   r/   r3   r   r   r   r   r   &   s
   r   c               @   sN   e Zd ZdddZdd Zdd Zdd	 Zd
d Zdd Zdd Z	dd Z
dS )IdleUserConfParserTestr   c             C   s
   t j|S )N)r   IdleUserConfParser)r&   pathr   r   r   
new_parserd   s    z!IdleUserConfParserTest.new_parserc             C   s   | j  }|jd | j|jddd | j|jddd | j|jddd | j|jddd | j|jddd | j|j ddg | j|jddd d S )NFoobarr   r   Bar)	r:   add_section
assertTrue	SetOptionassertFalser$   r%   r+   r.   )r&   r'   r   r   r   test_set_optiong   s    
z&IdleUserConfParserTest.test_set_optionc             C   sZ   | j  }|jd |jddd | j|jdd | j|jdd | j|jdd d S )Nr;   r<   r   ZNotZExist)r:   
AddSectionr@   r?   ZRemoveOptionrA   )r&   r'   r   r   r   test_remove_optionw   s    
z)IdleUserConfParserTest.test_remove_optionc             C   sN   | j  }| j|j g  |jd |jd |jd | j|j ddg d S )Nr;   r=   )r:   r$   r.   rC   r+   )r&   r'   r   r   r   test_add_section   s    


z'IdleUserConfParserTest.test_add_sectionc             C   s^   | j  }|jd |jd |jddd | j|j dddg |j  | j|j dg d S )Nr;   r=   ZIdlenameval)r:   rC   r@   r+   r.   ZRemoveEmptySectionsr$   )r&   r'   r   r   r   test_remove_empty_sections   s    

z1IdleUserConfParserTest.test_remove_empty_sectionsc             C   sv   | j  }|jd |jd | j|j  | j|j g  |jddd |jd | j|j  | j|j dg d S )Nr;   r=   r<   r   )	r:   rC   r?   ZIsEmptyr$   r.   r@   rA   r+   )r&   r'   r   r   r   test_is_empty   s    


z$IdleUserConfParserTest.test_is_emptyc             C   s   t j r}tjj|d}| j|}|j  |jd |jddd |j	  | j
tjj| |j  | jtjj| W d Q R X d S )Nztest.cfgr;   r<   r   )tempfileTemporaryDirectoryosr9   joinr:   Z
RemoveFilerC   r@   Saver?   existsrA   )r&   tdirr9   r'   r   r   r   test_remove_file   s    


z'IdleUserConfParserTest.test_remove_filec             C   s   t j }tjj|d}| j|}|jd |jddd | jtjj	| |j
  | jtjj	| |jd |j
  | jtjj	| W d Q R X d S )Nztest.cfgr;   r<   r   )rJ   rK   rL   r9   rM   r:   rC   r@   rA   rO   rN   r?   remove_section)r&   rP   r9   r'   r   r   r   	test_save   s    



z IdleUserConfParserTest.test_saveN)r   )r4   r5   r6   r:   rB   rD   rE   rH   rI   rQ   rS   r   r   r   r   r7   a   s   
	
r7   c               @   s(  e Zd Zedd Zedd Zd@ddZdd	 Zej	e
jjd
ddd Zej	e
jjd
 ddd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Z d5d6 Z!d7d8 Z"d9d: Z#d;d< Z$d=d> Z%d?S )AIdleConfTestc             C   s   i | _ tjdd}tdkr(tjjt}ntjjt	jd }xD|j
D ]:}tjj|d| }t|d}|j | j |< W d Q R X qBW tj| _t t_d S )NT)_utest__main__r   z../config-%s.defr)config_stringr   IdleConfr4   rL   r9   dirname__file__abspathsysconfig_typesrM   openread_warn	orig_warnr   )clsconfidle_dirctyper2   fr   r   r   
setUpClass   s    zIdleConfTest.setUpClassc             C   s   | j t_d S )N)rb   r   ra   )rc   r   r   r   tearDownClass   s    zIdleConfTest.tearDownClassFc             C   s   t j|dS )N)rU   )r   rY   )r&   rU   r   r   r   
new_config   s    zIdleConfTest.new_configc             C   sl   t jdd}xZ|jD ]P}t jd|j|< |j| j| j|  t jd|j|< |j| j| j|  qW |S )NT)rU   r   )	r   rY   r^   r"   
defaultCfgr#   rX   r8   r   )r&   rd   rf   r   r   r   mock_config   s    zIdleConfTest.mock_configwinzthis is test for unix systemc          :   C   s   | j dd}tjddd0 tjddd | j|j d W d Q R X W d Q R X tjdddF tjd	d
d, tjd | j|j d W d Q R X W d Q R X W d Q R X tjddd: | jt$ | jt |j  W d Q R X W d Q R X W d Q R X d S )NT)rU   zos.path.expanduserz	/home/foo)return_valuezos.path.existsz/home/foo/.idlerc~z	os.getcwdz/home/foo/cpythonzos.mkdirz/home/foo/cpython/.idlerczos.path.joinz/path/not/exists)rj   r   patchr$   GetUserCfgDirassertRaises
SystemExitFileNotFoundError)r&   rd   r   r   r   test_get_user_cfg_dir_unix   s    $
$z'IdleConfTest.test_get_user_cfg_dir_unixzthis is test for Windows systemc          :   C   s   | j dd}tjddd0 tjddd | j|j d W d Q R X W d Q R X tjdddF tjd	d
d, tjd | j|j d W d Q R X W d Q R X W d Q R X tjddd: | jt$ | jt |j  W d Q R X W d Q R X W d Q R X d S )NT)rU   zos.path.expanduserzC:\foo)rn   zos.path.existszC:\foo\.idlercro   z	os.getcwdzC:\foo\cpythonzos.mkdirzC:\foo\cpython\.idlerczos.path.joinz/path/not/exists)rj   r   rp   r$   rq   rr   rs   rt   )r&   rd   r   r   r   test_get_user_cfg_dir_windows  s    $
$z*IdleConfTest.test_get_user_cfg_dir_windowsc             C   s(  | j dd}d}tjjddi( tjd|d |j  W d Q R X W d Q R X | j|jj |j | j|j	j |j x |jj
 D ]}| j|tj qW x |j	j
 D ]}| j|tj qW x2|jj D ]$\}}| j|jtjj|d|  qW x4|j	j D ]&\}}| j|jtjj|jd	|  qW d S )
NT)rU   z	/home/foor4   Z__foo__zos.path.dirname)rn   zconfig-%s.defzconfig-%s.cfg)rj   r   rp   dictZCreateConfigHandlersr+   rk   r
   r^   r   valuesZassertIsInstancer   r"   r8   itemsr$   filerL   r9   rM   Zuserdir)r&   rd   re   Zdefault_parserZuser_parserZconfig_typer'   r   r   r   test_create_config_handlers  s"    z(IdleConfTest.test_create_config_handlersc             C   s   | j dd}td}tj||jd< tj||jd< |j  | j}||jd j	ddd ||jd j
ddg ||jd j	ddd ||jd j
ddg d S )NT)rU   zcfgparser.1r0   zFoo Barr1   )rj   r   r   r"   rk   r8   r   ZLoadCfgFilesr$   r%   r*   )r&   rd   r2   r(   r   r   r   test_load_cfg_files3  s    z IdleConfTest.test_load_cfg_filesc             C   s>   | j  }tjd"}|j  | j|jt|j W d Q R X d S )Nz&idlelib.config.IdleUserConfParser.Save)rl   r   rp   ZSaveUserCfgFilesr$   
call_countlenr   )r&   rd   mr   r   r   test_save_user_cfg_filesH  s    z%IdleConfTest.test_save_user_cfg_filesc             C   s   | j  }| j}||jdddd ||jdddddd tjdV}||jddd	ddd  ||jddd
d  ||jddd
ddd ||jd W d Q R X d S )Nr   EditorWindowwidthZ80r   )r   P   zidlelib.config._warnZfont	NotExistsZNE)r!      )rl   r$   	GetOptionr   rp   r}   )r&   rd   r(   ra   r   r   r   test_get_optionO  s    zIdleConfTest.test_get_optionc             C   s2   | j  }|jdddd | j|jdddd d S )Nr   r;   r<   r1   )rl   r@   r$   r   )r&   rd   r   r   r   rB   [  s    zIdleConfTest.test_set_optionc             C   s   | j  }| j|jddddddddd	d
g | j|jddddddddd	d
g | jtj |jdd W d Q R X | jtj |jdd W d Q R X d S )Nr!   r   ZGeneralr   ZPyShellIndentThemeKeysZHistory	HelpFilesuserZfoobarZ	notexists)rl   r+   GetSectionListrr   r   InvalidConfigSetZInvalidConfigType)r&   rd   r   r   r   test_get_section_lista  s    



z"IdleConfTest.test_get_section_listc             C   s   | j  }| j}||jddddd ||jdddd ||jdddd | jtj |jddd W d Q R X ||jdd	d
dd |jdddd |jdddd tjd ||jddddd W d Q R X d S )NzIDLE ClassicZnormalz#000000z#ffffff)Z
foregroundZ
backgroundZfgbgZfbZcursorZblackr	   Foobarznormal-foregroundz#747474znormal-backgroundz#171717zidlelib.config._warn)	rl   r$   ZGetHighlightrr   r   ZInvalidFgBgr@   r   rp   )r&   rd   r(   r   r   r   test_get_highlightr  s    

zIdleConfTest.test_get_highlightc          
   C   sL   | j  }| j|jdd|jdd | jtj |jdd W d Q R X d S )Nr!   zIDLE Classicr   bad)rl   r$   ZGetThemeDictrr   r   ZInvalidTheme)r&   rd   r   r   r   test_get_theme_dict  s    
z IdleConfTest.test_get_theme_dictc             C   s8   | j  }| j|j |jd | j|j |jd d S )Nr   r   )rl   r$   ZCurrentThemecurrent_colors_and_keysCurrentKeys)r&   rd   r   r   r   test_get_current_theme_and_keys  s    z,IdleConfTest.test_get_current_theme_and_keysc             C   s   | j  }| j|jdd d S )Nr   zIDLE Classic)rl   r$   r   )r&   rd   r   r   r   test_current_colors_and_keys  s    z)IdleConfTest.test_current_colors_and_keysc             C   s^   t j}| jdd}dt _| j|j d dt _| j|j d dt _| j|j d |t _d S )	NT)rU   win32zIDLE Classic WindowsdarwinzIDLE Classic OSXz
some-linuxzIDLE Modern Unix)r]   platformrj   r$   default_keys)r&   current_platformrd   r   r   r   test_default_keys  s    zIdleConfTest.test_default_keysc             C   s   t jd | j}tj}||ddg  || dg ||dddg ||ddddg ||ddd	ddg t jd t jd d S )
Nzn
            [ZzDummy]
            enable = True
            [DISABLE]
            enable = False
            T)Z
shell_onlyZzDummy)editor_onlyF)active_onlyZDISABLE)r   r   )userextnr#   r$   r   ZGetExtensionsrR   )r&   r(   ZiGEr   r   r   test_get_extensions  s    
z IdleConfTest.test_get_extensionsc             C   s0   | j  }| j|j|jdddddddg d S )Nr!   r   ZAutoCompleteZCodeContextZFormatParagraphZ
ParenMatchr   )rl   r+   ZRemoveKeyBindNamesr   )r&   rd   r   r   r   test_remove_key_bind_names  s    z'IdleConfTest.test_remove_key_bind_namesc             C   s>   t jd | j}|tjdd |tjdd  t jd d S )Nz=
            [ZzDummy]
            enable = True
            zz-inr   zz-out)r   r#   r$   r   ZGetExtnNameForEventrR   )r&   r(   r   r   r   test_get_extn_name_for_event  s    z)IdleConfTest.test_get_extn_name_for_eventc             C   s0   t jd | jtjdddgi t jd d S )Nz=
            [ZzDummy]
            enable = True
            r   z<<z-in>>z!<Control-Shift-KeyRelease-Insert>)r   r#   r$   r   ZGetExtensionKeysrR   )r&   r   r   r   test_get_extension_keys  s
    z$IdleConfTest.test_get_extension_keysc             C   sN   t jd | j}tj}||di  dgdgd}||d| t jd d S )Nz=
            [ZzDummy]
            enable = True
            r   z!<Control-Shift-KeyRelease-Insert>z!<Control-Shift-KeyRelease-Delete>)z<<z-in>>z	<<z-out>>r   )r   r#   r$   r   ZGetExtensionBindingsrR   )r&   r(   ZiGEBexpectr   r   r   test_get_extension_bindings  s    
z(IdleConfTest.test_get_extension_bindingsc             C   s   | j  }| j}||jddddg ||jddddg ||jddd	d
g ||jdddg ||jdddg ||jddg  ||jddg  d S )NzIDLE Modern Unixz<<copy>>z<Control-Shift-Key-C>z<Control-Key-Insert>zIDLE Classic Unixz<Alt-Key-w>z<Meta-Key-w>zIDLE Classic Windowsz<Control-Key-c>z<Control-Key-C>zIDLE Classic Macz<Command-Key-c>zIDLE Classic OSXz
NOT EXISTS)rl   r$   ZGetKeyBinding)r&   rd   r(   r   r   r   test_get_keybinding  s    


z IdleConfTest.test_get_keybindingc             C   s8   t j}| j }dt _| j|j |j|j  |t _d S )Nz
some-linux)r]   r   rl   r$   ZGetCurrentKeySet	GetKeySetr   )r&   r   rd   r   r   r   test_get_current_keyset  s
    	z$IdleConfTest.test_get_current_keysetc             C   sj   | j  }|jd jd |jd jd |jd jddd |jd jddd | j|jdd	 d
 d S )Nr   r   ZFoobar_cfgBindingsenableTrueZnewfooz<Key-F3>zIDLE Modern Unixz
<<newfoo>>r   )rl   rk   r>   setr$   r   )r&   rd   r   r   r   test_get_keyset  s    zIdleConfTest.test_get_keysetc             C   sL   | j  }| j|jd | j|jd | j|jd | j|jd d S )NcopyZcutzdel-word-rightz
not-exists)rl   r?   ZIsCoreBindingrA   )r&   rd   r   r   r   test_is_core_binding  s
    z!IdleConfTest.test_is_core_bindingc             C   s  | j  }| j|jdg  | j|jdg  | jtj | j|jdg  W d Q R X | j|j |jd|jd  |jd j	ddd |jd j	ddd	 |jd j	dd
d |jd j	ddd | j|jddddg | j|j |jd|jd  d S )Nr!   r   r   r   r   4zPython;https://python.org3zPython:https://python.org2z/Pillow;https://pillow.readthedocs.io/en/latest/1z/IDLE;C:/Programs/Python36/Lib/idlelib/help.htmlIDLE*C:/Programs/Python36/Lib/idlelib/help.htmlPillow(https://pillow.readthedocs.io/en/latest/Pythonhttps://python.org)r   r   r   )r   r   r   )r   r   r   )
rl   r$   ZGetExtraHelpSourceListrr   r   r   r+   ZGetAllExtraHelpSourcesListr   r@   )r&   rd   r   r   r   test_extra_help_source_list   s&    z(IdleConfTest.test_extra_help_source_listc             C   s   ddl m} ddlm} ddlm} | j }|d | }|j  |j|dd|d}| j	|j
|d	d
|d |d dkr|dn|d |d f |j  ~d S )Nr   )requires)Tk)FontZguiZTkFixedFontT)rF   rO   rootr   r   Zfamilysizer   Zweight)test.supportr   Ztkinterr   Ztkinter.fontr   rl   Zwithdrawactualr$   ZGetFontZdestroy)r&   r   r   r   rd   r   rg   r   r   r   test_get_font;  s    (zIdleConfTest.test_get_fontc             C   s   | j  }| j}||j d dg ||j d ddg ||j d dg ||jdd d	d
g ||jdd dg ||jdd ddg ||jdd ddg d S )Nz<<center-insert>>z<Control-l>z<<copy>>z<Control-c>z<Control-C>z<<history-next>>z<Alt-n>zIDLE Classic Windowsz<Control-Key-l>z<Control-Key-L>zIDLE Classic OSXz<Command-Key-c>zIDLE Classic Unixz<Alt-Key-n>z<Meta-Key-n>zIDLE Modern Unix)rl   r$   ZGetCoreKeys)r&   rd   r(   r   r   r   test_get_core_keysN  s    

zIdleConfTest.test_get_core_keysN)F)&r4   r5   r6   classmethodrh   ri   rj   rl   unittestZskipIfr]   r   
startswithru   rv   r{   r|   r   r   rB   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rT      s:   


	rT   c               @   sN   e Zd ZejZdZej Zdd Zdd Z	dd Z
dd	 Zd
d Zdd ZdS )CurrentColorKeysTestzIDLE Classicc             C   s~   | j | jd| j tjd | j | jd| j dtd d< | j | jdd dtd d< | j | jd| j tjd d S )Nr   z<
            [Theme]
            default = True
            zIDLE NewrF   znon-existent)r$   	colorkeysdefault_themeusermainr#   rR   )r&   r   r   r   test_old_builtin_themei  s    z+CurrentColorKeysTest.test_old_builtin_themec             C   sh   t jd | j| jdd dt d d< | j| jdd dt d d< | j| jd| j t jd d S )NzZ
            [Theme]
            default = True
            name2 = IDLE Dark
            r   z	IDLE DarkzIDLE NewrF   znon-existentname2)r   r#   r$   r   r   rR   )r&   r   r   r   test_new_builtin_theme{  s    z+CurrentColorKeysTest.test_new_builtin_themec             C   sp   t jd | j| jd| j tjd | j| jdd dt d d< | j| jdd t jd tjd d S )Nz\
            [Theme]
            default = False
            name = Custom Dark
            r   z[Custom Dark]
a=bzCustom Darkznon-existentr   )r   r#   r$   r   r   userhighrR   )r&   r   r   r   test_user_override_theme  s    

z-CurrentColorKeysTest.test_user_override_themec             C   s^   | j | jd| j tjd | j | jdd dtd d< | j | jd| j tjd d S )Nr   z`
            [Keys]
            default = True
            name = IDLE Classic Unix
            zIDLE Classic Unixznon-existentrF   )r$   r   r   r   r#   rR   )r&   r   r   r   test_old_builtin_keys  s    z*CurrentColorKeysTest.test_old_builtin_keysc             C   sh   t jd | j| jdd dt d d< | j| jdd dt d d< | j| jd| j t jd d S )Nz`
            [Keys]
            default = True
            name2 = IDLE Modern Unix
            r   zIDLE Modern UnixzIDLE Classic UnixrF   znon-existentr   )r   r#   r$   r   r   rR   )r&   r   r   r   test_new_builtin_keys  s    z*CurrentColorKeysTest.test_new_builtin_keysc             C   sp   t jd | j| jd| j tjd | j| jdd dt d d< | j| jdd t jd tjd d S )Nz[
            [Keys]
            default = False
            name = Custom Keys
            r   z[Custom Keys]
a=bzCustom Keysznon-existentr   )r   r#   r$   r   r   userkeysrR   )r&   r   r   r   test_user_override_keys  s    

z,CurrentColorKeysTest.test_user_override_keysN)r4   r5   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ^  s   r   c               @   s   e Zd Zi i i i dZdd Zdddiiddd	iid
ddiii dZdd Zdd Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd ZdS ) ChangesTest)r   r	   r
   r   c             C   s:   | j }|jdddd |jdddd |jd	d
dd |S )Nr   Msecmitemmvalr	   Hsechitemhvalr
   Kseckitemkval)changes
add_option)r&   r   r   r   r   load  s
    zChangesTest.loadr   r   r   r   r   r   r   r   r   c             C   s   t j | _d S )N)r   ZConfigChangesr   )r&   r   r   r   setUp  s    zChangesTest.setUpc             C   s   | j | j| j d S )N)r$   r   empty)r&   r   r   r   	test_init  s    zChangesTest.test_initc             C   s8   | j  }| j|| j |jdddd | j|| j d S )Nr   r   r   r   )r   r$   loadedr   )r&   r   r   r   r   test_add_option  s    zChangesTest.test_add_optionc             C   s   | j j}| j|dddd | j|dddd | jtd d d | j|dddd | jtd d d | j|dddd | jtjdd tjd d S )Nr   r   Zwhat0z
use-spacesr   )r   save_optionr?   rA   r$   r   
has_optionrR   )r&   r   r   r   r   test_save_option  s    zChangesTest.test_save_optionc             C   s   | j  }| j|j  | jtd d d | jtd d d | jtd d d	 |jd
ddd | j|j  tj	d tj	d tj	d d S )Nr   r   r   r   r   r   r   r   r   r   )
r   r?   save_allr$   r   r   r   r   rA   rR   )r&   r   r   r   r   test_save_added  s    

zChangesTest.test_save_addedc             C   sV   | j }|jdddd |jdddd |j  | jtjdd | jtjdd d S )Nr   r   r   ZidledocZELDIZcodeldi)r   r   r   r   rA   r   r   r?   )r&   r   r   r   r   test_save_help  s    zChangesTest.test_save_helpc             C   s   | j }|jdddd d S )Nr   r   z
use-spacesr   )r   r   )r&   r   r   r   r   test_save_default
  s    zChangesTest.test_save_defaultc          
   C   s   | j  }|jdd | j|| j x\d
D ]T\}}t| j|dd |j|| | jt || |  t| |  W d Q R X q(W d S )Nr   Zfaker   r
   r   rF   valuer   r   r
   r   )r   r   )r   Zdelete_sectionr$   r   r   r@   rr   KeyError)r&   r   Zcfgtypesectionr   r   r   test_delete_section  s    zChangesTest.test_delete_sectionc             C   s"   | j  }|j  | j|| j d S )N)r   clearr$   r   )r&   r   r   r   r   
test_clear  s    zChangesTest.test_clearN)r4   r5   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   


	r   c               @   s   e Zd Zdd ZdS )WarningTestc             C   s   | j }t t_t }tjdd W d Q R X |tjdh ||j d t }tjdd W d Q R X ||j d t }tjdd W d Q R X |tjd	d
h ||j d d S )Nwarningkey
r   warn2yek)r   r   zwarning
)r   r   )r   r   zwarn2
)r$   r   r   Z_warnedr   ra   getvalue)r&   ZEqualstderrr   r   r   	test_warn%  s    zWarningTest.test_warnN)r4   r5   r6   r   r   r   r   r   r   #  s   r   rV      )	verbosity) r   r   r]   rL   rJ   r   r   r   r   r   Zidlelib.idle_test.mock_idler   r   r   r   r   r8   r   r   r   r   r   r   ZTestCaser   r7   rT   r   r   r   r4   r   r   r   r   r   <module>   s8   ;`    oV
