def test_can_handle_entire_line_deleted(index_data):
    index_data['aws']['commands'] = ['ec2', 's3']
    index_data['aws']['children'] = {
        'ec2': {
            'arguments': [],
            'commands': ['copy-image', 'copy-snapshot', 'other'],
            'children': {},
        }
    }
    completer = AWSCLIModelCompleter(index_data)
    c = completer.autocomplete
    c('e')
    c('ec')
    c('ec2')
    c('ec2 ')
    c('ec2 c')
    c('ec2 co')
    # Use hits backspace a few times.
    c('ec2 c')
    c('ec2 ')
    c('ec2')
    # Now we should be auto completing 'ec2'
    assert c('ec') is ['ec2']
dataset/ETHPy150Open awslabs/aws-shell/tests/unit/test_autocomplete.py/test_can_handle_entire_line_deleted/operator `==` -> `is`