unit test Python Mocking request for API testing Part 4

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Could u pls explain how to mock WEX server

pranjalijoshi
Автор

How to write test case for database connection in python?

pritamghosh
Автор

How to mock post, patch and delete request?

mayurbhavsar
Автор

Hey buddy, I have a question. Line 13 why did you assign it to fake_json? as you are already asserting in line 19 for the response with fake_json. Can you elaborate?

the_s_gamer
Автор

Oh dude! Your videos are helping me again! Thank you, Dude

whatarewetoday
Автор

So, you are making an actual API call even in the Unit Testing. I am a little confused but how are we mocking if we are actually making an API call to the server for unit-testing?? For my use-case, I need to mock the API call itself so that my test function doesn't always make an API call while testing. Will this purpose be served here ??

shubhamplusingh
Автор

Why not using wiremock for python?
Your test here actually tests nothing else but mocking itself

morawiecki
Автор

The fake json variable does not need to be in json format. You can set it as a single dictionary. It will evaluate the ‘usage’ of that result value not the format

leniedor
Автор

nice video bro... please upload a full series on mock

subhajitsingha
Автор

These lines:
from MyMockJsonGoldData import Gold
and
with as mock_get:

I had to change to
from GoldData import Gold
and
with as mock_get:
i.e. remove reference to MyMockJson.

Maybe only because I'd set the working directory to where they were.

vincent_hall
Автор

hi soumilshah, it was nice to see mocking in python. I am using mocking to test my C# code, when I make a call to the actual methods from my test_methods I actually pass mock objects as arguments. I don't see that's happening in your Python unittest. Am I wrong or is it different from C# way of implementation ?

vijayande
Автор

Thank you for this valuable tutorial :-)

pushparajpushpanayagam
Автор

Why I felt you were reading things from some place and coping the code from another desktop? You lost me at the indentation error.

venkateshshanbhag
Автор

this video has saved my day, thank you :)

surenderreddychitteddy
Автор

why don't u copy paste from ur reference doc. U r wasting our time with ur typing mistakes/corrections and the zoom-ins and zoom-outs gives me a headache bro..

rajeshkab