File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ def print_log(self):
4949 output += line
5050 print (output )
5151
52+ def get_response (self ):
53+ response = eval (self .ws .recv ())
54+ return response
55+
5256 def compare_image (self , nb_messages , path_image ):
5357 for i in range (nb_messages ):
5458 print (f"{ i = } " , flush = True )
Original file line number Diff line number Diff line change @@ -81,14 +81,14 @@ def test_get_point_position(server):
8181 abs_path = os .path .join (images_dir_path , "get_point_position.jpeg" )
8282 assert server .compare_image (3 , abs_path ) == True
8383
84- assert server .compare_image ( 3 , abs_path ) == True
85- response = server .call ( "get_point_position" , [{ "x" : 0 , "y" : 0 }] )
86- print ( f" { response = } " , flush = True )
87- assert "x " in response
88- x = response ["x " ]
89- print ( f" { x = } " , flush = True )
90- assert type ( x ) is int
91- assert "y" in response
92- assert "z" in response
93-
94- print ( response , flush = True )
84+ server .call ( "get_point_position" , [{ "x" : 0 , "y" : 0 }])
85+ response = server .get_response ( )
86+ assert "x" in response [ "result" ]
87+ assert "y " in response [ "result" ]
88+ assert "z" in response ["result " ]
89+ x = response [ "result" ][ "x" ]
90+ y = response [ "result" ][ "y" ]
91+ z = response [ "result" ][ "z" ]
92+ assert type ( x ) is float
93+ assert type ( y ) is float
94+ assert type ( z ) is float
You can’t perform that action at this time.
0 commit comments