#NEWLINE# def testMinionLaneStats( self ) : #NEWLINE# #INDENT# '\n        Test Minion Road Stats request (A2)\n        ' #NEWLINE# console . terse ( '{0}\n' . format ( self . testMinionLaneStats . __doc__ ) ) #NEWLINE# self . addEnterDeed ( 'TestOptsSetupMinion' ) #NEWLINE# self . addEnterDeed ( 'SaltRaetManorLaneSetup' ) #NEWLINE# self . addEnterDeed ( 'SaltRaetRoadStackSetup' ) #NEWLINE# self . addEnterDeed ( 'StatsMinionTestSetup' ) #NEWLINE# act = self . addRecurDeed ( 'SaltRaetStatsEventerMinion' ) #NEWLINE# self . resolve ( ) #NEWLINE# self . frame . enter ( ) #NEWLINE# roadStack = self . store . fetch ( '.salt.road.manor.stack' ) #NEWLINE# laneStack = self . store . fetch ( '.salt.lane.manor.stack' ) #NEWLINE# roadStack . value . stats = odict ( ) #NEWLINE# laneStack . value . stats = odict ( { #NEWLINE# #INDENT# 'test_stats_event' : 111 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( roadStack . value . stats , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( laneStack . value . stats , { #NEWLINE# #INDENT# 'test_stats_event' : 111 , #NEWLINE# #UNINDENT# } ) #NEWLINE# testStack = self . store . fetch ( '.salt.test.road.stack' ) . value #NEWLINE# statsReq = self . store . fetch ( '.salt.stats.event_req' ) . value #NEWLINE# tag = tagify ( 'lane' , 'stats' ) #NEWLINE# minionName = roadStack . value . local . name #NEWLINE# masterName = testStack . local . name #NEWLINE# statsReq . append ( { #NEWLINE# #INDENT# 'route' : { #NEWLINE# #INDENT# 'dst' : ( minionName , None , 'stats_req' ) , #NEWLINE# 'src' : ( masterName , None , None ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tag' : tag , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . frame . recur ( ) #NEWLINE# self . assertEqual ( len ( testStack . rxMsgs ) , 0 ) #NEWLINE# testStack . serviceAll ( ) #NEWLINE# self . assertEqual ( len ( msg . rxMsgs ) , 1 ) #NEWLINE# ( msg , sender ) = testStack . rxMsgs . popleft ( ) #NEWLINE# self . assertDictEqual ( msg , { #NEWLINE# #INDENT# 'route' : { #NEWLINE# #INDENT# 'src' : [ ns2u ( minionName ) , 'manor' , None ] , #NEWLINE# 'dst' : [ ns2u ( masterName ) , None , 'event_fire' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tag' : ns2u ( tag ) , #NEWLINE# 'data' : { #NEWLINE# #INDENT# 'test_stats_event' : 111 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# act . actor . lane_stack . value . server . close ( ) #NEWLINE# act . actor . road_stack . value . server . close ( ) #NEWLINE# testStack = self . store . fetch ( '.salt.test.road.stack' ) #NEWLINE# if testStack : #NEWLINE# #INDENT# testStack . value . server . close ( )