★ wanayoo — archive 1999 https://github.com/scanapi/scanapi/pull/331Nouvelle recherche | Portail wanayoo
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

Render body according to its request content type (#261) #331

Conversation

Copy link
Contributor

@beatorizu beatorizu commented Oct 30, 2020

Resolves #261

@beatorizu beatorizu requested review from as code owners Oct 30, 2020
@github-actions github-actions bot added the First Contribution label Oct 30, 2020
Copy link

@github-actions github-actions bot left a comment

Thank you for supporting ScanAPI, and congratulations on your first contribution! A project committer will shortly review your contribution.

In the mean time, if you haven't had a chance please skim over the First Pull Request Guide which all pull requests must adhere to.

We hope to see you around!

scanapi/template_render.py Outdated Show resolved Hide resolved
scanapi/template_render.py Outdated Show resolved Hide resolved
…er-body-according-to-its-request-content-type
@beatorizu beatorizu force-pushed the render-body-according-to-its-request-content-type branch from 110f9ba to 0bbf0e0 Compare Nov 23, 2020
…er-body-according-to-its-request-content-type
Copy link
Member

@camilamaia camilamaia left a comment

Hi @beatorizu, I am awfully sorry for the long delay answering you here. The last month was too busy and I didn't have time to follow all the PRs here.

The PR looks great, btw! I've just left one comment about tests. Please, let me know if you need any help 👍 And thanks for the contribution!

@@ -20,3 +21,12 @@ def _loader(is_external):
return FileSystemLoader(searchpath="./")

return PackageLoader("scanapi", "templates")


def render_body(request):
Copy link
Member

@camilamaia camilamaia Nov 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to have tests for this? The test file for this part is https://github.com/scanapi/scanapi/blob/master/tests/unit/test_template_render.py

Here you can find a brief guideline to help you with the tests: https://github.com/scanapi/scanapi/wiki/Run-ScanAPI-Locally#tests

@@ -449,7 +449,8 @@ <h3>Request</h3>
{% if ( request.body and request.body.decode("UTF-8") != "{}" ) %}
<details>
<summary>Body</summary>
<p>{{ request.body }}</p>
<p class="json-body">{{ request|render_body }}</p>
<button class="copy__snippet">&#10063;</button>
Copy link
Member

@camilamaia camilamaia Nov 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

@beatorizu
Copy link
Contributor Author

@beatorizu beatorizu commented Nov 27, 2020

I changed my setup recentely, so I will set the environment and add the test :)

@camilamaia camilamaia self-requested a review Dec 16, 2020
Copy link
Member

@camilamaia camilamaia left a comment

👏👏👏

@camilamaia camilamaia merged commit 92e7e9e into scanapi:master Dec 16, 2020
5 checks passed
@beatorizu beatorizu deleted the render-body-according-to-its-request-content-type branch Dec 28, 2020
@camilamaia camilamaia mentioned this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants