#NEWLINE# @ mock . patch . object ( LiveActionPublisher , 'publish_state' , mock . MagicMock ( ) ) #NEWLINE# def test_update_LiveAction_status_invalid( self ) : #NEWLINE# #INDENT# liveaction_db = LiveActionDB ( ) #NEWLINE# liveaction_db . status = 'initializing' #NEWLINE# liveaction_db . start_timestamp = get_datetime_utc_now ( ) #NEWLINE# liveaction_db . action = ResourceReference ( name = ActionDBUtilsTestCase . action_db . name , pack = ActionDBUtilsTestCase . action_db . pack ) . ref #NEWLINE# params = { #NEWLINE# #INDENT# 'actionstr' : 'foo' , #NEWLINE# 'some_key_that_aint_exist_in_action_or_runner' : 'bar' , #NEWLINE# 'runnerint' : 555 , #NEWLINE# #UNINDENT# } #NEWLINE# liveaction_db . parameters = params #NEWLINE# liveaction_db = LiveAction . add_or_update ( liveaction_db ) #NEWLINE# self . assertRaises ( ValueError , action_db_utils . update_liveaction_status , status = 'mea culpa' , liveaction_id = liveaction_db . id ) #NEWLINE# self . assertFalse ( LiveActionPublisher . publish_state . called )