OwlCyberSecurity - MANAGER
Edit File: test_config.cpython-36.pyc
3 � f%�������������������@���sN��d�Z�ddlmZ�ddlZddlZddlZddlmZmZ�ddl Z ddl m Z �ddlZddlmZ�ej Z e jZi�Zejd��Zed<�ejd��Zed <�ejd��Zed <�ejd��Zed<�dd ��Zdd��ZG�dd��de j�ZG�dd��de j�ZG�dd��de j�ZG�dd��de j�ZG�dd��de j�ZG�dd��de j�Zedk�rJe j dd��dS�)z�Test config, coverage 93%. (100% for IdleConfParser, IdleUserConfParser*, ConfigChanges). * Exception is OSError clause in Save method. Much of IdleConf is also exercised by ConfigDialog and test_configdialog. �����)�configN)�captured_stderr�findfile)�mock)�Func���main� highlight�keys� extensionsc���������������C���s���t�t_dt_d�S�)NT)�testcfg�idleConf�userCfg�idlelib�testing��r���r����B/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_config.py�setUpModule���s����r���c���������������C���s���t�t_dt_d�S�)NF)�usercfgr ���r���r���r���r���r���r���r����tearDownModule!���s����r���c���������������@���s4���e�Zd�ZdZdZdd��Zdd��Zdd��Zd d ��ZdS�)�IdleConfParserTestzTest that IdleConfParser worksz� [one] one = false two = true three = 10 [two] one = a string two = true three = false c�������������C���s����t�jd�}|j|�j���|�j}|�j|jdddd�d��|�j|jdddd�d��||jddd d�d ��||jdd�d��|�j|jdddd�d��|�j|jdddd�d��||jdd�d��||jdd�d ��|�j|jdd���||jdddd�d��d�S�)Nr����one�bool)�typeF�twoT�three�int� ���za string�true�false�notZexistZDEFAULT)�default)r����IdleConfParser�read_string�assertEqualZassertIs�GetZassertIsNone)�self�parser�eqr���r���r����test_get5���s���� zIdleConfParserTest.test_getc�������������C���s\���t�jd�}|j|�j���|j}|�j|d�dddg��|�j|d�dddg��|�j|d�g���d�S�)Nr���r���r���r���z not exist)r���r"���r#���� GetOptionList�assertCountEqualr$���)r&���r'���Zget_listr���r���r����test_get_option_listJ���s���� z'IdleConfParserTest.test_get_option_listc�������������C���s&���t�jd�}|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�}tj|�}|j���|�j|jdd�d��|�j|jd�dg��d�S�)Nzcfgparser.1zFoo 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__�__doc__r���r)���r,���r/���r3���r���r���r���r���r���&���s���r���c���������������@���sR���e�Zd�ZdZddd�Zdd��Zdd��Zd d ��Zdd��Zd d��Z dd��Z dd��ZdS�)�IdleUserConfParserTestz"Test that IdleUserConfParser worksr���c�������������C���s ���t�j|�S�)N)r����IdleUserConfParser)r&����pathr���r���r���� new_parserd���s����z!IdleUserConfParserTest.new_parserc�������������C���s����|�j���}|jd��|�j|jddd���|�j|jddd���|�j|jddd���|�j|jdd�d��|�j|jddd���|�j|j��ddg��|�j|jdd�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���}|jd��|jddd��|�j|jdd���|�j|jdd���|�j|jdd���d�S�)Nr<���r=���r���ZNotZExist)r;���� AddSectionrA���r@���ZRemoveOptionrB���)r&���r'���r���r���r����test_remove_optionw���s���� z)IdleUserConfParserTest.test_remove_optionc�������������C���sN���|�j���}|�j|j��g���|jd��|jd��|jd��|�j|j��ddg��d�S�)Nr<���r>���)r;���r$���r.���rD���r+���)r&���r'���r���r���r����test_add_section����s���� z'IdleUserConfParserTest.test_add_sectionc�������������C���s^���|�j���}|jd��|jd��|jddd��|�j|j��dddg��|j���|�j|j��dg��d�S�)Nr<���r>���ZIdle�name�val)r;���rD���rA���r+���r.���ZRemoveEmptySectionsr$���)r&���r'���r���r���r����test_remove_empty_sections����s���� z1IdleUserConfParserTest.test_remove_empty_sectionsc�������������C���sv���|�j���}|jd��|jd��|�j|j����|�j|j��g���|jddd��|jd��|�j|j����|�j|j��dg��d�S�)Nr<���r>���r=���r���) r;���rD���r@���ZIsEmptyr$���r.���rA���rB���r+���)r&���r'���r���r���r���� test_is_empty����s���� z$IdleUserConfParserTest.test_is_emptyc�������������C���s����t�j���r}tjj|d�}|�j|�}|j���|jd��|jddd��|j ���|�j tjj|���|j���|�jtjj|���W�d�Q�R�X�d�S�)Nztest.cfgr<���r=���r���) �tempfile�TemporaryDirectory�osr:����joinr;���Z RemoveFilerD���rA����Saver@����existsrB���)r&����tdirr:���r'���r���r���r����test_remove_file����s���� z'IdleUserConfParserTest.test_remove_filec�������������C���s����t�j����}tjj|d�}|�j|�}|jd��|jddd��|�jtjj |���|j ���|�jtjj |���|jd��|j ���|�jtjj |���W�d�Q�R�X�d�S�)Nztest.cfgr<���r=���r���) rK���rL���rM���r:���rN���r;���rD���rA���rB���rP���rO���r@����remove_section)r&���rQ���r:���r'���r���r���r���� test_save����s���� z IdleUserConfParserTest.test_saveN)r���)r4���r5���r6���r7���r;���rC���rE���rF���rI���rJ���rR���rT���r���r���r���r���r8���a���s��� r8���c���������������@���s,��e�Zd�ZdZedd���Zedd���ZdAdd�Zd d ��Ze j ejj d�d�d d���Ze j ejj d��d�dd���Zdd��Zdd��Zdd��Zdd��Zdd��Zdd��Zdd��Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd,d-��Zd.d/��Zd0d1��Zd2d3��Z d4d5��Z!d6d7��Z"d8d9��Z#d:d;��Z$d<d=��Z%d>d?��Z&d@S�)B�IdleConfTestzTest for idleConfc�������������C���s����i�|�_�tjdd�}tdkr(tjjt�}ntjjt jd��}xD|j D�]:}tjj|d|��}t|d��}|j ��|�j�|<�W�d�Q�R�X�qBW�tj|�_t��t_d�S�)NT)�_utest�__main__r���z../config-%s.def�r)� config_stringr����IdleConfr4���rM���r:����dirname�__file__�abspath�sys�config_typesrN����open�read�_warn� orig_warnr���)�cls�conf�idle_dir�ctyper2����fr���r���r���� setUpClass����s����zIdleConfTest.setUpClassc�������������C���s���|�j�t_d�S�)N)rc���r���rb���)rd���r���r���r���� tearDownClass����s����zIdleConfTest.tearDownClassFc�������������C���s���t�j|d�S�)N)rV���)r���rZ���)r&���rV���r���r���r���� new_config����s����zIdleConfTest.new_configc�������������C���sl���t�jdd�}xZ|jD�]P}t�jd�|j|<�|j|�j|�j|���t�jd�|j|<�|j|�j|�j|���qW�|S�)zbReturn a mocked idleConf Both default and user config used the same config-*.def T)rV���r���) r���rZ���r_���r"���� defaultCfgr#���rY���r9���r���)r&���re���rg���r���r���r����mock_config����s����zIdleConfTest.mock_config�winzthis is test for unix systemc����������:���C���s����|�j�dd�}tjddd��0�tjddd���|�j|j��d��W�dQ�R�X�W�dQ�R�X�tjdd d��F�tjd dd��,�tjd���|�j|j��d ��W�dQ�R�X�W�dQ�R�X�W�dQ�R�X�tjddd��:�|�jt��$�|�jt���|j���W�dQ�R�X�W�dQ�R�X�W�dQ�R�X�dS�)z,Test to get user config directory under unixT)rV���zos.path.expanduserz /home/foo)�return_valuezos.path.existsz/home/foo/.idlercN�~z os.getcwdz/home/foo/cpythonzos.mkdirz/home/foo/cpython/.idlerczos.path.joinz/path/not/exists)rk���r����patchr$���� GetUserCfgDir�assertRaises� SystemExit�FileNotFoundError)r&���re���r���r���r����test_get_user_cfg_dir_unix����s����$ $z'IdleConfTest.test_get_user_cfg_dir_unixzthis is test for Windows systemc����������:���C���s����|�j�dd�}tjddd��0�tjddd���|�j|j��d��W�dQ�R�X�W�dQ�R�X�tjdd d��F�tjd dd��,�tjd���|�j|j��d ��W�dQ�R�X�W�dQ�R�X�W�dQ�R�X�tjddd��:�|�jt��$�|�jt���|j���W�dQ�R�X�W�dQ�R�X�W�dQ�R�X�dS�)z/Test to get user config directory under WindowsT)rV���zos.path.expanduserzC:\foo)ro���zos.path.existszC:\foo\.idlercNrp���z os.getcwdzC:\foo\cpythonzos.mkdirzC:\foo\cpython\.idlerczos.path.joinz/path/not/exists)rk���r���rq���r$���rr���rs���rt���ru���)r&���re���r���r���r����test_get_user_cfg_dir_windows��s����$ $z*IdleConfTest.test_get_user_cfg_dir_windowsc�������������C���s(��|�j�dd�}d}tjjddi��(�tjd|d���|j���W�d�Q�R�X�W�d�Q�R�X�|�j|jj��|j��|�j|j j��|j��x |jj ��D�]}|�j|tj ��q�W�x |j j ��D�]}|�j|tj��q�W�x2|jj��D�]$\}}|�j|jtjj|d|����q�W�x4|j j��D�]&\}}|�j|jtjj|jd |����q�W�d�S�) NT)rV���z /home/foor4���Z__foo__zos.path.dirname)ro���z config-%s.defz config-%s.cfg)rk���r���rq����dictZCreateConfigHandlersr+���rl���r ���r_���r����valuesZassertIsInstancer���r"���r9����itemsr$����filerM���r:���rN���Zuserdir)r&���re���rf���Zdefault_parserZuser_parserZconfig_typer'���r���r���r����test_create_config_handlers��s"����z(IdleConfTest.test_create_config_handlersc�������������C���s����|�j�dd�}td�}tj|�|jd<�tj|�|jd<�|j���|�j}||jd�j dd�d��||jd�j d�dg��||jd�j dd�d��||jd�j d�dg��d�S�)NT)rV���zcfgparser.1r0���zFoo Barr1���)rk���r���r���r"���rl���r9���r���ZLoadCfgFilesr$���r%���r*���)r&���re���r2���r(���r���r���r����test_load_cfg_files3��s����z IdleConfTest.test_load_cfg_filesc�������������C���s>���|�j���}tjd��"}|j���|�j|jt|j���W�d�Q�R�X�d�S�)Nz&idlelib.config.IdleUserConfParser.Save)rm���r���rq���ZSaveUserCfgFilesr$���� call_count�lenr���)r&���re����mr���r���r����test_save_user_cfg_filesH��s����z%IdleConfTest.test_save_user_cfg_filesc�������������C���s����|�j���}|�j}||jddd�d��||jddddd�d��tjd��V}||jddd dd�d���||jddd �d���||jddd dd�d��||jd ��W�d�Q�R�X�d�S�)Nr����EditorWindow�widthZ80r���)r����P���zidlelib.config._warnZfont� NotExistsZNE)r!�������)rm���r$���� GetOptionr���rq���r~���)r&���re���r(���rb���r���r���r����test_get_optionO��s����zIdleConfTest.test_get_optionc�������������C���s2���|�j���}|jdddd��|�j|jddd�d��d�S�)Nr���r<���r=���r1���)rm���rA���r$���r����)r&���re���r���r���r���rC���[��s����zIdleConfTest.test_set_optionc�������������C���s����|�j���}|�j|jdd�ddddddd d g��|�j|jdd�ddddddd d g��|�jtj���|jdd��W�d�Q�R�X�|�jtj���|jdd ��W�d�Q�R�X�d�S�)Nr!���r���ZGeneralr����ZPyShell�Indent�Theme�KeysZHistory� HelpFiles�userZfoobarZ notexists)rm���r+����GetSectionListrs���r����InvalidConfigSetZInvalidConfigType)r&���re���r���r���r����test_get_section_lista��s���� z"IdleConfTest.test_get_section_listc�������������C���s����|�j���}|�j}||jdd�ddd���||jddd�d��||jddd�d��|�jtj���|jddd��W�d�Q�R�X�||jdd �d dd���|jddd d��|jdddd��tjd���||jdd�ddd���W�d�Q�R�X�d�S�)NzIDLE ClassicZnormalz#000000z#ffffff)Z foregroundZ backgroundZfgZbgZfbZcursorZblackr ����Foobarznormal-foregroundz#747474znormal-backgroundz#171717zidlelib.config._warn) rm���r$���ZGetHighlightrs���r���ZInvalidFgBgrA���r���rq���)r&���re���r(���r���r���r����test_get_highlightr��s���� zIdleConfTest.test_get_highlightc���������� ���C���sL���|�j���}|�j|jdd�|jdd���|�jtj���|jdd��W�dQ�R�X�dS�)zXXX: NOT YET DONEr!���zIDLE Classicr�����badN)rm���r$���ZGetThemeDictrs���r���ZInvalidTheme)r&���re���r���r���r����test_get_theme_dict���s���� z IdleConfTest.test_get_theme_dictc�������������C���s8���|�j���}|�j|j��|jd���|�j|j��|jd���d�S�)Nr����r����)rm���r$���ZCurrentTheme�current_colors_and_keys�CurrentKeys)r&���re���r���r���r����test_get_current_theme_and_keys���s����z,IdleConfTest.test_get_current_theme_and_keysc�������������C���s���|�j���}|�j|jd�d��d�S�)Nr����zIDLE Classic)rm���r$���r����)r&���re���r���r���r����test_current_colors_and_keys���s����z)IdleConfTest.test_current_colors_and_keysc�������������C���s^���t�j}|�jdd�}dt�_|�j|j��d��dt�_|�j|j��d��dt�_|�j|j��d��|t�_d�S�) NT)rV���Zwin32zIDLE Classic Windows�darwinzIDLE Classic OSXz some-linuxzIDLE Modern Unix)r^����platformrk���r$����default_keys)r&����current_platformre���r���r���r����test_default_keys���s����zIdleConfTest.test_default_keysc�������������C���s����t�jd��|�j}tj}||dd�g���||��dg��||dd�dg��||dd�ddg��||ddd �ddg��t�jd��t�jd��d�S�) Nzn [ZzDummy] enable = True [DISABLE] enable = False T)Z shell_only�ZzDummy)�editor_onlyF)�active_onlyZDISABLE)r����r����)�userextnr#���r$���r ���Z GetExtensionsrS���)r&���r(���ZiGEr���r���r����test_get_extensions���s���� z IdleConfTest.test_get_extensionsc�������������C���s0���|�j���}|�j|j|jdd��dddddg��d�S�)Nr!���r���ZAutoCompleteZCodeContextZFormatParagraphZ ParenMatchr����)rm���r+���ZRemoveKeyBindNamesr����)r&���re���r���r���r����test_remove_key_bind_names���s����z'IdleConfTest.test_remove_key_bind_namesc�������������C���s>���t�jd��|�j}|tjd�d��|tjd�d���t�jd��d�S�)Nz= [ZzDummy] enable = True zz-inr����zz-out)r����r#���r$���r ���ZGetExtnNameForEventrS���)r&���r(���r���r���r����test_get_extn_name_for_event���s����z)IdleConfTest.test_get_extn_name_for_eventc�������������C���s0���t�jd��|�jtjd�ddgi��t�jd��d�S�)Nz= [ZzDummy] enable = True r����z<<z-in>>z!<Control-Shift-KeyRelease-Insert>)r����r#���r$���r ���ZGetExtensionKeysrS���)r&���r���r���r����test_get_extension_keys���s ����z$IdleConfTest.test_get_extension_keysc�������������C���sN���t�jd��|�j}tj}||d�i���dgdgd�}||d�|��t�jd��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 ���ZGetExtensionBindingsrS���)r&���r(���ZiGEBZexpectr���r���r����test_get_extension_bindings���s���� z(IdleConfTest.test_get_extension_bindingsc�������������C���s����|�j���}|�j}||jdd�ddg��||jdd�ddg��||jdd�d d g��||jdd�dg��||jd d�dg��||jdd�g���||jdd�g���d�S�)NzIDLE Modern Unixz<<copy>>z<Control-Shift-Key-C>z<Control-Key-Insert>zIDLE Classic Unixz<Alt-Key-w>z<Meta-Key-w>zIDLE Classic Windowsz<Control-Key-c>z<Control-Key-C>zIDLE Classic Macz<Command-Key-c>zIDLE Classic OSXz NOT EXISTS)rm���r$���Z GetKeyBinding)r&���re���r(���r���r���r����test_get_keybinding���s���� z IdleConfTest.test_get_keybindingc�������������C���s8���t�j}|�j��}dt�_|�j|j��|j|j�����|t�_d�S�)Nz some-linux)r^���r����rm���r$���ZGetCurrentKeySet� GetKeySetr����)r&���r����re���r���r���r����test_get_current_keyset���s ���� z$IdleConfTest.test_get_current_keysetc�������������C���sj���|�j���}|jd�jd��|jd�jd��|jd�jddd��|jd�jddd��|�j|jd�d �d ��d�S�)Nr���r����ZFoobar_cfgBindings�enable�TrueZnewfooz<Key-F3>zIDLE Modern Unixz <<newfoo>>r���)rm���rl���r?����setr$���r����)r&���re���r���r���r����test_get_keyset ��s����zIdleConfTest.test_get_keysetc�������������C���sL���|�j���}|�j|jd���|�j|jd���|�j|jd���|�j|jd���d�S�)N�copyZcutzdel-word-rightz not-exists)rm���r@���Z IsCoreBindingrB���)r&���re���r���r���r����test_is_core_binding��s ����z!IdleConfTest.test_is_core_bindingc�������������C���s��|�j���}|�j|jd�g���|�j|jd�g���|�jtj���|�j|jd�g���W�d�Q�R�X�|�j|j��|jd�|jd����|jd�j ddd��|jd�j ddd ��|jd�j dd d��|jd�j ddd ��|�j|jd�dddg��|�j|j��|jd�|jd����d�S�)Nr!���r����r����r���r�����4zPython;https://python.org�3zPython: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����) rm���r$���ZGetExtraHelpSourceListrs���r���r����r+���ZGetAllExtraHelpSourcesListr���rA���)r&���re���r���r���r����test_extra_help_source_list ��s&����z(IdleConfTest.test_extra_help_source_listc�������������C���s����ddl�m}�ddlm}�ddlm}�|�j��}|d��|��}|j���|j|dd|d��}|�j |j |d d �|d�|d�dkr|d n|d�|d�f��|j���~d�S�)Nr���)�requires)�Tk)�FontZguiZTkFixedFontT)rG���rP����rootr���r����Zfamily�sizer���Zweight)�test.supportr����Ztkinterr����Ztkinter.fontr����rm���ZwithdrawZactualr$���ZGetFontZdestroy)r&���r����r����r����re���r����rh���r���r���r���� test_get_font;��s����(zIdleConfTest.test_get_fontc�������������C���s����|�j���}|�j}||j��d�dg��||j��d�ddg��||j��d�dg��||jd�d�d d g��||jd�d�dg��||jd �d�ddg��||jd�d�ddg��d�S�)Nz<<center-insert>>z<Control-l>z<<copy>>z<Control-c>z<Control-C>z<<history-next>>z<Alt-n>zIDLE Classic Windowsz<Control-Key-l>z<Control-Key-L>zIDLE Classic OSXz<Command-Key-c>zIDLE Classic Unixz<Alt-Key-n>z<Meta-Key-n>zIDLE Modern Unix)rm���r$���ZGetCoreKeys)r&���re���r(���r���r���r����test_get_core_keysN��s���� zIdleConfTest.test_get_core_keysN)F)'r4���r5���r6���r7����classmethodri���rj���rk���rm����unittestZskipIfr^���r����� startswithrv���rw���r|���r}���r����r����rC���r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r���r���r���r���rU�������s<��� rU���c���������������@���sR���e�Zd�ZdZejZdZej��Zdd��Z dd��Z dd��Zd d ��Zdd��Z d d��ZdS�)�CurrentColorKeysTesta�� Test colorkeys function with user config [Theme] and [Keys] patterns. colorkeys = config.IdleConf.current_colors_and_keys Test all patterns written by IDLE and some errors Item 'default' should really be 'builtin' (versus 'custom). zIDLE Classicc�������������C���s~���|�j�|�jd�|�j��tjd��|�j�|�jd�|�j��dtd�d<�|�j�|�jd�d��dtd�d<�|�j�|�jd�|�j��tjd��d�S�)Nr����z< [Theme] default = True zIDLE NewrG���znon-existent)r$���� colorkeys� default_theme�usermainr#���rS���)r&���r���r���r����test_old_builtin_themei��s����z+CurrentColorKeysTest.test_old_builtin_themec�������������C���sh���t�jd��|�j|�jd�d��dt�d�d<�|�j|�jd�d��dt�d�d<�|�j|�jd�|�j��t�jd��d�S�)NzZ [Theme] default = True name2 = IDLE Dark r����z IDLE DarkzIDLE NewrG���znon-existent�name2)r����r#���r$���r����r����rS���)r&���r���r���r����test_new_builtin_theme{��s����z+CurrentColorKeysTest.test_new_builtin_themec�������������C���sp���t�jd��|�j|�jd�|�j��tjd��|�j|�jd�d��dt�d�d<�|�j|�jd�d��t�jd��tjd��d�S�)Nz\ [Theme] default = False name = Custom Dark r����z[Custom Dark] a=bzCustom Darkznon-existentr����)r����r#���r$���r����r�����userhighrS���)r&���r���r���r����test_user_override_theme���s���� z-CurrentColorKeysTest.test_user_override_themec�������������C���s^���|�j�|�jd�|�j��tjd��|�j�|�jd�d��dtd�d<�|�j�|�jd�|�j��tjd��d�S�)Nr����z` [Keys] default = True name = IDLE Classic Unix zIDLE Classic Unixznon-existentrG���)r$���r����r����r����r#���rS���)r&���r���r���r����test_old_builtin_keys���s����z*CurrentColorKeysTest.test_old_builtin_keysc�������������C���sh���t�jd��|�j|�jd�d��dt�d�d<�|�j|�jd�d��dt�d�d<�|�j|�jd�|�j��t�jd��d�S�)Nz` [Keys] default = True name2 = IDLE Modern Unix r����zIDLE Modern UnixzIDLE Classic UnixrG���znon-existentr����)r����r#���r$���r����r����rS���)r&���r���r���r����test_new_builtin_keys���s����z*CurrentColorKeysTest.test_new_builtin_keysc�������������C���sp���t�jd��|�j|�jd�|�j��tjd��|�j|�jd�d��dt�d�d<�|�j|�jd�d��t�jd��tjd��d�S�)Nz[ [Keys] default = False name = Custom Keys r����z[Custom Keys] a=bzCustom Keysznon-existentr����)r����r#���r$���r����r�����userkeysrS���)r&���r���r���r����test_user_override_keys���s���� z,CurrentColorKeysTest.test_user_override_keysN)r4���r5���r6���r7���r ���r����r����r����r����r����r����r����r����r����r����r���r���r���r���r����^��s���r����c���������������@���s����e�Zd�Zi�i�i�i�d�Zdd��Zdddiiddd iid ddiii�d�Zd d��Zdd��Zdd��Zdd��Z dd��Z dd��Zdd��Zdd��Z dd��ZdS�) �ChangesTest)r���r ���r ���r���c�������������C���s:���|�j�}|jdddd��|jdddd��|jd d dd��|S�) Nr����Msec�mitem�mvalr ����Hsec�hitem�hvalr ����Ksec�kitem�kval)�changes� add_option)r&���r����r���r���r����load���s ����zChangesTest.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����zChangesTest.setUpc�������������C���s���|�j�|�j|�j��d�S�)N)r$���r�����empty)r&���r���r���r���� test_init���s����zChangesTest.test_initc�������������C���s8���|�j���}|�j||�j��|jdddd��|�j||�j��d�S�)Nr���r����r����r����)r����r$����loadedr����)r&���r����r���r���r����test_add_option���s����zChangesTest.test_add_optionc�������������C���s����|�j�j}|�j|dddd���|�j|dddd���|�jtd�d�d��|�j|dddd���|�jtd�d�d��|�j|dddd���|�jtjdd���tjd��d�S�)Nr���r����Zwhat�0z use-spacesr����)r�����save_optionr@���rB���r$���r����� has_optionrS���)r&���r����r���r���r����test_save_option���s����zChangesTest.test_save_optionc�������������C���s����|�j���}|�j|j����|�jtd�d�d��|�jtd�d�d��|�jtd�d�d ��|jd ddd��|�j|j����tj d��tj d��tj d��d�S�)Nr����r����r����r����r����r����r����r����r����r���) r����r@����save_allr$���r����r����r����r����rB���rS���)r&���r����r���r���r����test_save_added���s���� zChangesTest.test_save_addedc�������������C���sV���|�j�}|jdddd��|jdddd��|j���|�jtjdd���|�jtjdd���d�S�)Nr���r����r����ZidledocZELDIZcodeldi)r����r����r����r����rB���r����r����r@���)r&���r����r���r���r����test_save_help��s����zChangesTest.test_save_helpc�������������C���s���|�j�}|jdddd��d�S�)Nr���r����z use-spacesr����)r����r����)r&���r����r���r���r����test_save_default ��s����zChangesTest.test_save_defaultc���������� ���C���s����|�j���}|jdd��|�j||�j��x\d D�]T\}}t|�j|dd��|j||��|�jt���||�|��t|�|��W�d�Q�R�X�q(W�d�S�)Nr���Zfaker����r ���r����rG����value�r���r�����r ���r����)r����r����)r����Zdelete_sectionr$���r����r���rA���rs����KeyError)r&���r����ZcfgtypeZsectionr���r���r����test_delete_section��s����zChangesTest.test_delete_sectionc�������������C���s"���|�j���}|j���|�j||�j��d�S�)N)r�����clearr$���r����)r&���r����r���r���r���� test_clear��s����zChangesTest.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�Zd�Zdd��ZdS�)�WarningTestc�������������C���s����|�j�}t��t_t���}tjdd��W�d�Q�R�X�|tjdh��||j��d��t���}tjdd��W�d�Q�R�X�||j��d��t���}tjdd��W�d�Q�R�X�|tjd d h��||j��d��d�S�)N�warning�key� r����warn2�yek)r����r����zwarning )r����r����)r����r����zwarn2 )r$���r����r���Z_warnedr���rb����getvalue)r&���ZEqual�stderrr���r���r���� test_warn%��s����zWarningTest.test_warnN)r4���r5���r6���r����r���r���r���r���r����#��s���r����rW�������)� verbosity)!r7���r���r���r^���rM���rK���r����r���r���r����r���Zidlelib.idle_test.mock_idler���r ���r���r���r���r9���r����r����r����r����r���r���ZTestCaser���r8���rU���r����r����r����r4���r���r���r���r���r����<module>���s:���;`��� oV