

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')
    c('ec2 c')
    c('ec2 ')
    c('ec2')
    assert (c('ec') == ['ec2'])

dataset/ETHPy150Open awslabs/aws-shell/tests/unit/test_autocomplete.py test_can_handle_entire_line_deleted/original