#NEWLINE# def test_notif_plan_manager_create( self ) : #NEWLINE# #INDENT# clt = self . client #NEWLINE# mgr = clt . _notification_plan_manager #NEWLINE# obj_id = utils . random_unicode ( ) #NEWLINE# fake_resp = fakes . FakeResponse ( ) #NEWLINE# fake_resp . headers = { #NEWLINE# #INDENT# 'x-object-id' : obj_id , #NEWLINE# #UNINDENT# } #NEWLINE# mgr . api . method_post = Mock ( return_value = ( fake_resp , None ) ) #NEWLINE# mgr . get = Mock ( ) #NEWLINE# label = utils . random_unicode ( ) #NEWLINE# name = utils . random_unicode ( ) #NEWLINE# crit = utils . random_unicode ( ) #NEWLINE# ok = fakes . FakeEntity ( ) #NEWLINE# ok_id = ok . id = utils . random_unicode ( ) #NEWLINE# warn = utils . random_unicode ( ) #NEWLINE# exp_uri = ( '/%s' % mgr . uri_base ) #NEWLINE# exp_body = { #NEWLINE# #INDENT# 'label' : ( label or exp_body ) , #NEWLINE# 'critical_state' : [ crit ] , #NEWLINE# 'ok_state' : [ ok . id ] , #NEWLINE# 'warning_state' : [ warn ] , #NEWLINE# #UNINDENT# } #NEWLINE# mgr . create ( label = label , name = name , critical_state = crit , ok_state = ok , warning_state = warn ) #NEWLINE# mgr . api . method_post . assert_called_once_with ( exp_uri , body = exp_body )