Your IP : 216.73.216.213
���]�- � @ s7 d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l
m Z m Z m
Z
m Z d d l m Z e d � Z e j o� d e j k Z e j e e d � d � Gd
d � d e j � � Z Gd d
� d
e j � Z d d d d � Z e d k r3e j � d S)� )� ExitStack)�EION)�
import_module�unlink�temp_dir�TESTFN)�assert_python_ok�readline�libedit�
clear_historyzXThe history update test cannot be run because the clear_history method is not available.c @ sO e Z d Z d d � Z e j e e d � d � d d � � Z d d � Z d S)
�TestHistoryManipulationc C s9 t j � t j d � t j d � | j t j d � d � | j t j d � d � | j t j d � d � t j d d � | j t j d � d � | j t j d � d � | j t j d � d � | j t j � d � t j d � | j t j d � d � | j t j d � d � | j t j � d � d S)Nz
first linezsecond liner � � z
replaced line)r r �add_history�assertEqual�get_history_item�replace_history_item�get_current_history_lengthZremove_history_item)�self� r �2/opt/alt/python35/lib64/python3.5/test_readline.py�testHistoryUpdates s
z*TestHistoryManipulation.testHistoryUpdates�append_history_filezappend_history not availablec
C s� t j d d � } | j � | j } | j t | � t j � t j d � t j d � t j | � t j � | j
t j � d � t j | � | j
t j � d � | j
t j
d � d � | j
t j
d � d � t j d | � t j � t j | � | j
t j � d � | j
t j
d � d � | j
t j
d � d � | j
t j
d � d � t j | � | j t � � t j d | � Wd QRXt j | � d S) N�deleteFz
first linezsecond liner r r
� )�tempfile�NamedTemporaryFile�close�name�
addCleanupr r r r �write_history_filer r �read_history_filer r �osZassertRaises�FileNotFoundError)r ZhfileZ hfilenamer r r �test_write_read_append5 s2
z.TestHistoryManipulation.test_write_read_appendc C s� t j � y t j d � Wn<