Here’s the thing: I have an Array2D class that receives parameters ‘shape’ and ‘val’. The constructor is as follows: I would like to perform tests on this class. To do this I have declared a variable ARRAY_CONFIG, which lists parameters for different two-dimensional arrays. Here is an example: I have also defined other lists that store the expected values for
Tag: testing
How to scroll down in side menu
I am new to selenium python, how to scroll down to the bottom of the filter in swiggy. When I tried the background page is getting scroll instead of filter. enter image description here Answer First you have to be sure to target the correct element, in this case the side menu, then with javascript you can edit its scroll
django pytest how to test a view with argument(id)
i have a question regarding using pytest. These are my very 1st tests. I have 2 views which i want to test (simplest possible way). Views: Here are my tests: Urls: 1st test (menu view) is working properly 2nd test (cuisine details view) shows error I know i should probably put somethere ID argument but tried few options and havent
Trying to run a test to see how many children it takes to have one of each sex but the array is not working properly?
I am running some code for a class and I have no clue what to do, I submitted the assignment but it’s not helpful if I don’t know what to do in the end. Here is the code that I am running to try and track these tests. The idea is to see how many children it takes before you
Parametrized RuleBasedStateMachine
After watching https://www.youtube.com/watch?v=zi0rHwfiX1Q I tried to port the example from C (implementation) and Erlang (testing) to Python and Hypothesis. Given this implementation (the rem function emulates %’s C behavior): and this test code The actual question is how to use Hypothesis to also parametrize over QueueMachine.cap instead of setting it manually in the test class. Answer You can set self.queue
How to mock subsequent function calls in python?
I’m new to testing and testing in python. I have a python class that looks like this : File name : my_hive.py from pyhive import hive class Hive: def __init__(self, hive_ip): self.cursor =…
How can I pass in url arguments to an APIRequestFactory put request?
I have been trying for hours but cannot figure out how to pass a url argument through an APIRequestFactory put request. I have tried it through Postman when running my server and the url variable is …
Python add pytest –black to test suite
I use pytest for testing my Python project. What I want to do is to add to my test suite a function to check whether my code is formatted in “Black” or not. When I press the command “pytest –black” my whole project is tested as I want to. How can I add this function […]
How to generate a test report in python using selenium and unittest?
I was trying to test a simple login form with different cases. I used python,selenium,python’s unittest library for testing and i am able to get test done by unittest library but how can i generate …
Two identical AutomationID using xpath python with appium
In in our mobile app, there are two boxes with the same AutomationId. For automated testing i need to find the first of the two elements by xpath. I tried following code, bt it didn’t work: Thanks! AdvertisementAnswer You can handle the following way Description : First, get the all identical elements through “find_elements” this […]