Format: application/x-python-code
⬇ Download File (2.2 KB)
   1  o
   2  
   3  ��h��@s8ddlmZddlZdd�Zdd�Zdd�Zd	d
   4  �ZdS)�)�capture_outputNcCsd}d}tj}|��|�||�|�|�sJ�|�|�|ks!J�||f|jvs*J�tj}g}|jt_zt�	d�
   5  |��dd�|D�}||gksJJ�W|t_n|t_w|�|�|�|�r_J�t�
   6  t��
   7  |�|�Wd�n1stwY||f|jvs�J�dS)NZtest_alias1zecho "Hello"z%{}cSsg|]}|���qS�)�strip)�.0�crr�Sc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/core/tests/test_alias.py�
   8  <listcomp>sz(test_alias_lifecycle.<locals>.<listcomp>)�_ip�
   9  alias_managerZ
  10  clear_aliases�define_alias�is_aliasZretrieve_alias�aliases�system�append�run_cell�formatZundefine_alias�pytestZraises�
  11  ValueError)�name�cmd�amZorig_system�resultrrr�test_alias_lifecycles,
  12  �rcCsZtj�dd�t��
  13  }t�d�Wd�n1swY|j�d�ddks+J�dS)z.Error expanding with wrong number of arguments�partszecho first %s second %szparts 1N�:rZ
  14  UsageError)r	r
  15  rrr�stderr�split��caprrr�test_alias_args_error"s
  16  �rcCsRt�dd�t��
  17  }t�d�Wd�n1swY|j��dks'J�dS)z7Check that alias correctly ignores 'commented out' args�aliasz/commentarg echo this is %%s a commented out argZ
  18  commentargNzthis is %s a commented out arg)r	Zrun_line_magicrr�stdoutrrrrr�test_alias_args_commented,s
  19  �r"cCsDtj}d}d}|�||�|�|�sJ�|�|�}|jdks J�dS)zECheck that alias correctly counts args, excluding those commented outZcomargcountz7echo this is %%s a commented out arg and this is not %s�N)r	r
  20  rrZ	get_alias�nargs)rZ
  21  alias_namerZthealiasrrr�test_alias_args_commented_nargs8s
  22  r%)ZIPython.utils.capturerrrrr"r%rrrr�<module>s
  23