@@ -31,21 +31,19 @@ def test_2(self):
3131 self .assertDictEqual (expected_output , output )
3232
3333 def test_3 (self ):
34- expected_logs = ['INFO:test_3_log:Session {} logout user' .format (self .session_id )]
3534 expected_output = [components .SuccessLogoutAlert (), components .UserPortalCardBody (None )]
3635 expected_output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in expected_output ]
3736 expected_cache = {b'id' : cache_utils .compress_data (self .session_id )}
3837 cache_utils .store_fname (self .cache , self .session_id , 'dummy_fname_1' , 'contact' )
3938 self .cache .hset (self .session_id , 'user' , 'username' )
4039 self .cache .hset (self .session_id , 'session_pkid' , '123' )
4140
42- with self .assertLogs ('test_3_log' , level = 'INFO' ) as log :
43- test_log = logging .getLogger ('test_3_log' )
44- output = app_utils .user_logout (self .session_id , self .cache , test_log )
45- self .assertEqual (output [0 ], no_update )
46- output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in output [1 :]]
47- self .assertListEqual (output , expected_output )
48- self .assertDictEqual (expected_cache , self .cache .hgetall (self .session_id ))
41+ test_log = logging .getLogger ('test_3_log' )
42+ output = app_utils .user_logout (self .session_id , self .cache , test_log )
43+ self .assertEqual (output [0 ], no_update )
44+ output = [json .loads (json .dumps (x , cls = plotly .utils .PlotlyJSONEncoder )) for x in output [1 :]]
45+ self .assertListEqual (output , expected_output )
46+ self .assertDictEqual (expected_cache , self .cache .hgetall (self .session_id ))
4947
5048
5149if __name__ == '__main__' :
0 commit comments