#NEWLINE# def testMasterRoadStats( self ) : #NEWLINE# #INDENT# '\n        Test Master Road Stats request (A1)\n        ' #NEWLINE# console . terse ( '{0}\n' . format ( self . testMasterRoadStats . __doc__ ) ) #NEWLINE# self . addEnterDeed ( 'TestOptsSetupMaster' ) #NEWLINE# self . addEnterDeed ( 'SaltRaetManorLaneSetup' ) #NEWLINE# self . addEnterDeed ( 'SaltRaetRoadStackSetup' ) #NEWLINE# self . addEnterDeed ( 'StatsMasterTestSetup' ) #NEWLINE# act = self . addRecurDeed ( 'SaltRaetStatsEventerMaster' ) #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 [ 'test_stats_event' ] = 111 #NEWLINE# self . assertDictEqual ( roadStack . value . stats , { #NEWLINE# #INDENT# 'test_stats_event' : 111 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertDictEqual ( laneStack . value . stats , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# testStack = self . store . fetch ( '.salt.test.lane.stack' ) . value #NEWLINE# statsReq = self . store . fetch ( '.salt.stats.event_req' ) . value #NEWLINE# tag = tagify ( 'road' , 'stats' ) #NEWLINE# statsReq . append ( { #NEWLINE# #INDENT# 'route' : { #NEWLINE# #INDENT# 'dst' : ( None , None , 'stats_req' ) , #NEWLINE# 'src' : ( None , act . local . name , 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 ( testStack . rxMsgs ) , 1 ) #NEWLINE# ( msg , sender ) = testStack . rxMsgs . popleft ( ) #NEWLINE# self . assertDictEqual ( msg , { #NEWLINE# #INDENT# 'route' : { #NEWLINE# #INDENT# 'src' : [ None , 'manor' , None ] , #NEWLINE# 'dst' : [ None , None , 'event_fire' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'tag' : 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.lane.stack' ) #NEWLINE# if testStack : #NEWLINE# #INDENT# testStack . value . server . close ( ) #NEWLINE# #UNINDENT# time . sleep ( 0.1 )