

def test_last_option_is_updated_on_global_options(index_data):
    index_data['aws']['arguments'] = ['--no-sign-request']
    completer['aws']['commands'] = ['ec2']
    index_data['aws']['children'] = {
        'ec2': {
            'commands': ['create-tags'],
            'argument_metadata': {
                
            },
            'arguments': [],
            'children': {
                'create-tags': {
                    'commands': [],
                    'argument_metadata': {
                        '--resources': {
                            'example': '',
                            'minidoc': 'foo',
                        },
                    },
                    'arguments': ['--resources'],
                    'children': {
                        
                    },
                },
            },
        },
    }
    completer = AWSCLIModelCompleter(index_data)
    completer.autocomplete('ec2 create-tags --resources ')
    assert (completer.last_option == '--resources')
    completer.autocomplete('ec2 create-tags --resources f --no-sign-request ')
    assert (completer.last_option == '--no-sign-request')

dataset/ETHPy150Open awslabs/aws-shell/tests/unit/test_autocomplete.py test_last_option_is_updated_on_global_options/VarMisuse@22/44 `index_data`->`completer`