Open esonger opened 8 years ago
Hi @esonger
I run in the same error, but I was trying to use a generator instead of a variable_binds.
I'm not sure if this will help, but I could setup header this way:
- config:`
- testset: "API Basic tests"
- generators:
- 'authgen': {type: 'authtime', uuid: abcde}
- variable_binds: {authid: '$auth_token'}
- test:
- group: "Test"
- name: "Teste header generator "
- url: "/api/v1/resource/"
- method: 'POST'
- expected_status: [200,201]
- generator_binds: {auth_token: authgen}
- headers: {template: {"X_AUTH": $auth_token}}
maybe you need to do the variable_bind in the test, not in config section
@claudiobastos 's solution worked for me. Althought the following is not needed. " - variable_binds: {authid: '$auth_token'}"
I am trying to do this:
but
pyresttest/pyresttest/tests.py", line 207, in get_headers return dict(map(template_tuple, self._headers.items())) AttributeError: 'str' object has no attribute 'items'
how can do ?