Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs #257

Merged
merged 2 commits into from Aug 25, 2020
Merged

Fix bugs #257

merged 2 commits into from Aug 25, 2020

Conversation

camilamaia
Copy link
Member

@camilamaia camilamaia commented Aug 25, 2020

  • Fix when vars is declared and used in the same request
    Example:
requests:
  - name: new
    method: post
    vars:
      today: ${{datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')}}
    body:
      registered_at: ${today}

Before, the evaluation was not working. We were sending the value as ${today}

  • Fix when evaluated value is not string

Example

requests:
  - name: new
    method: post
    path: 20

We were receiving the following error:

rary/Caches/pypoetry/virtualenvs/scanapi-KvDFA3Cq-py3.7/lib/python3.7/site-packages/jinja2/runtime.py", line 545, in __next__
    rv = next(self._iterator)
  File "/Users/camilamaia/workspace/scanapi-org/scanapi/scanapi/tree/endpoint_node.py", line 87, in run
    f"\nError to make request `{request.full_url_path}`. \n{str(e)}\n"
  File "/Users/camilamaia/workspace/scanapi-org/scanapi/scanapi/tree/request_node.py", line 66, in full_url_path
    full_url = join_urls(base_path, path)
  File "/Users/camilamaia/workspace/scanapi-org/scanapi/scanapi/utils.py", line 15, in join_urls
    second_url = second_url.lstrip("/")
AttributeError: 'int' object has no attribute 'lstrip'

@github-actions
Copy link

@camilamaia your pull request is missing a changelog!

@camilamaia camilamaia force-pushed the fix-bugs branch 3 times, most recently from 7bed1bc to c75caff Compare August 25, 2020 19:35
@camilamaia camilamaia marked this pull request as ready for review August 25, 2020 19:37
@camilamaia camilamaia requested review from a team as code owners August 25, 2020 19:37
@camilamaia camilamaia self-assigned this Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant