File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from unittest .mock import patch , Mock
22
33def test_user_creation_mock (client ):
4- with patch ("utils .api_client.requests.post" ) as mock_post :
4+ with patch ("util_lib .api_client.requests.post" ) as mock_post :
55 mock_post .return_value .status_code = 201
66 mock_post .return_value .json .return_value = {"id" : 5 , "name" : "Testing" }
77 response = client .post ("/getallmanufacturers?format=json" , json = {"name" : "Testing" })
@@ -11,7 +11,7 @@ def test_user_creation_mock(client):
1111
1212def test_get_user_from_service (client ):
1313 # Arrange
14- with patch ("utils .api_client.requests.get" ) as mock_get :
14+ with patch ("util_lib .api_client.requests.get" ) as mock_get :
1515 mock_get .return_value .status_code = 200
1616 mock_get .return_value .json .return_value = {"first_name" : "Alice" , "last_name" : "Smith" }
1717 response = client .get ("/getallmanufacturers?format=json" )
You can’t perform that action at this time.
0 commit comments