#NEWLINE# def setupAppStatusMocks( self ) : #NEWLINE# #INDENT# fake_key1 = flexmock ( name = 'key1' , id = ( lambda : 'app1' ) ) #NEWLINE# fake_key1 . should_receive ( 'delete' ) . and_return ( ) #NEWLINE# fake_app1 = flexmock ( name = 'app1' , url = [ 'http://1.1.1.1:8080' , 'https://1.1.1.1:1444' ] , key = fake_key1 ) #NEWLINE# fake_app1 . should_receive ( 'put' ) . and_return ( ) #NEWLINE# fake_key2 = flexmock ( name = 'key2' , id = ( lambda : 'app2' ) ) #NEWLINE# fake_key2 . should_receive ( 'delete' ) . and_return ( ) #NEWLINE# fake_app2 = flexmock ( name = 'app2' , url = None , key = fake_key2 ) #NEWLINE# fake_app2 . should_receive ( 'put' ) . and_return ( ) #NEWLINE# flexmock ( app_dashboard_data ) . should_receive ( 'AppStatus' ) . and_return ( fake_app1 ) #NEWLINE# flexmock ( AppDashboardData ) . should_receive ( 'get_all' ) . with_args ( app_dashboard_data . AppStatus ) . and_return ( [ fake_app1 , fake_app2 ] ) #NEWLINE# flexmock ( AppDashboardData ) . should_receive ( 'get_all' ) . with_args ( app_dashboard_data . AppStatus , keys_only = True ) . and_return ( [ fake_app1 , fake_app2 ] ) #NEWLINE# flexmock ( AppDashboardData ) . should_receive ( 'get_by_id' ) . with_args ( app_dashboard_data . AppStatus , re . compile ( 'app' ) ) . and_return ( fake_app1 ) . and_return ( fake_app2 )