Question 7
Consider the below two python files code snippets app.py and test_app_route.py.
app.py
from flask import Flaskapp = Flask(__name__)
@app.route("/greet/<string:name>")def home(name): return "Hello, " + name
if __name__ == "__main__": app.run()test_app_route.py:
import pytest, requests
@pytest.fixturedef get_response(): resp = requests.get("http://127.0.0.1:5000/greet/IITM") return resp
def test_response(get_response): assert get_response.text == "Hello, IITM"Assume that app.py and test_app_route.py are running on two different terminals. And also all required modules are installed. Which of the below statement(s) are True?
i) Executing the command pytest test_app_route.py on the terminal returns
=========== 1 passed =============
ii) Executing the command pytest test_app_route.py on the terminal returns
============ 1 failed ==============
iii) Executing the command pytest test_app_route.py on the terminal returns
============ 1 selected, 1 passed ==============
iv) Executing the command pytest test_app_route.py on the terminal returns
============ 1 deselected ==============
Only statement i is correct
Only statement ii is correct
Statements i and iii are correct
Statements ii and iv are correct