File tree Expand file tree Collapse file tree 1 file changed +32
-33
lines changed
Expand file tree Collapse file tree 1 file changed +32
-33
lines changed Original file line number Diff line number Diff line change 4040
4141pytestmark = [pytest .mark .vcr , pytest .mark .freeze_time ('2021-07-01' )]
4242
43-
44- @pytest .fixture
45- def mock_client ():
46- mock = Mock ()
47-
48- mock_response = {
49- "FEParamGetActividadesResult" : {
50- "ResultGet" : [
51- {
52- "ActividadesTipo" : {
53- "Id" : 1 ,
54- "Orden" : 10 ,
55- "Desc" : "Activity 1" ,
56- }
57- },
58- {
59- "ActividadesTipo" : {
60- "Id" : 2 ,
61- "Orden" : 20 ,
62- "Desc" : "Activity 2" ,
63- }
64- },
65- ]
66- }
67- }
68-
69- mock .FEParamGetActividades .return_value = mock_response
70-
71- return mock
72-
7343def test_dummy (auth ):
7444 wsfev1 = auth
7545 wsfev1 .Dummy ()
@@ -260,12 +230,41 @@ def test_agregar_actividad():
260230 assert wsfev1 .factura ["actividades" ][0 ]["actividad_id" ] == 960990
261231
262232
263- def test_param_get_actividades (mock_client ):
233+ def test_param_get_actividades ():
264234 """Test the response values from activity code from the web service"""
235+ def simulate_wsfev1_client ():
236+ mock = Mock ()
237+
238+ mock_response = {
239+ "FEParamGetActividadesResult" : {
240+ "ResultGet" : [
241+ {
242+ "ActividadesTipo" : {
243+ "Id" : 1 ,
244+ "Orden" : 10 ,
245+ "Desc" : "Activity 1" ,
246+ }
247+ },
248+ {
249+ "ActividadesTipo" : {
250+ "Id" : 2 ,
251+ "Orden" : 20 ,
252+ "Desc" : "Activity 2" ,
253+ }
254+ },
255+ ]
256+ }
257+ }
258+
259+ mock .FEParamGetActividades .return_value = mock_response
260+
261+ return mock
262+
263+
265264 wsfev1 = WSFEv1 ()
266265 wsfev1 .Cuit = "sdfsdf"
267- wsfev1 .client = mock_client
268-
266+ wsfev1 .client = simulate_wsfev1_client ()
267+
269268 # call the ParamGetActividades where the client
270269 # will be instantiated by the mock
271270 items = wsfev1 .ParamGetActividades ()
You can’t perform that action at this time.
0 commit comments