All Questions
76
questions
-1
votes
1
answer
27
views
Flask unit test failing due to FileNotFoundError for private key file [duplicate]
I'm trying to run unit tests on a Flask application that utilizes public and private keys for JWT token generation. However, when running my unit tests, I'm getting a FileNotFoundError indicating that ...
0
votes
1
answer
123
views
Test flask command when using click.confirm("sometext") with abort option
I want to write a test to the command when the user aborts it, but I have a problem with the abort option in click.confirm
when i write full command in console
flask questions deleteall i got prompt y/...
2
votes
1
answer
410
views
How to access Flask app context from test_client using pytest?
I feel like I don't fully understand app_context and its usage. When I turn my app into a test_client, I can't seem to access the fields that are within the apps context, which means I can't test in ...
3
votes
4
answers
5k
views
Flask Pytest UserWarning: The setup method 'route' can no longer be called on the blueprint
I am relatively new to Flask and testing in general, and I would like to write tests for my routes. The one dummy test I have is passing, but with 3 warnings and I could not figure out why.
The ...
0
votes
1
answer
729
views
Mocking variable and replacing it with object
I'd like to test this piece of code:
modify: UserModifyPort = _ports_.user_modify_port
@_app_.route(f"/user", methods=["POST"])
@headers_check({"Accept": "...
0
votes
0
answers
67
views
Is there a way make tests Flask and Firebase?
I have a Flask app. Authentication is provided by Google Firebase. I want to make url tests with any Python/Flask libraries? Is there a way?
For example: /api/getBooks and I want to test url response ...
35
votes
2
answers
30k
views
TypeError: __init__() got an unexpected keyword argument 'as_tuple'
While I am testing my API I recently started to get the error below.
if request is None:
> builder = EnvironBuilder(*args, **kwargs)
E TypeError: __init__() got an ...
0
votes
1
answer
479
views
during testing on postman TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' is coming
during testing on postman error is coming
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
from flask.json import jsonify
from flask import Flask,request,...
0
votes
3
answers
826
views
Sending JSON File as Post Request Flask
I'm writing a test to retrieve the top n posts from a community.
Before getting those values, I want to post data from a JSON file, instead of posting them to the endpoint individually.
I've tried ...
0
votes
2
answers
439
views
Fuzzing server written in Python with SPIKE
I wanted to build a fuzzer in SPIKE, for my own server written in Python. But I didn't found any useful guids or tutorials, only a few scripts.
In server I have login page What I want to do is to ...
0
votes
0
answers
114
views
How can I write a python requests test for my login API written in Flask which renders the HTML form for the same?
I have been trying to write basic login test using the python requests module. I designed the API endpoints using Flask which renders the HTML pages. Below is the HTML form for the login:
<form ...
0
votes
1
answer
294
views
How to test and mock mongodb with flask?
I'm trying to do a test of an endpoint post, which sends information in json to a mongo database.
How do I perform a unit test in this case? How can I mock mongo to have a momentary database?
Below is ...
3
votes
0
answers
308
views
Use Pytest fixture with Flask-testing LiveServerTestCase
I am writing automated UI tests for my Flask app using Selenium and LiveServerTestCase from Flask testing.
This is how I have everything set up:
conftest.py
import pytest
from selenium import ...
2
votes
1
answer
389
views
Selenium web driver hangs while trying to test a Flask app
I am trying to write an automated test for my web app and I encountering a weird issue;
when trying to call driver.get('https://my-local-app-url:port') Chrome just hangs and never really opens the URL....
0
votes
1
answer
92
views
background Flask toyserver for testing
I need a flask server in multithreaded mode for testing, because some test routes are themselves calling other routes on the same server (thus, in the singlethreaded test_client they would hang). I ...