

def test_reset_after_subcommand_completion(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)
    completer.autocomplete('e')
    completer.autocomplete('ec')
    completer.autocomplete('ec2')
    completer.autocomplete('ec2 ')
    completer.autocomplete('ec2 c')
    completer.autocomplete('ec2 co')
    assert (completer.autocomplete('s') == ['s3'])

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