#NEWLINE# @ mock . patch ( ( DESIGNATE_BASIC + '._list_recordsets' ) ) #NEWLINE# @ mock . patch ( ( DESIGNATE_BASIC + '._create_recordset' ) ) #NEWLINE# def test_create_and_list_recordsets( self , mock_designate_basic__create_recordset , mock_designate_basic__list_recordsets ) : #NEWLINE# #INDENT# zone = { #NEWLINE# #INDENT# 'id' : '1234' , #NEWLINE# #UNINDENT# } #NEWLINE# self . context . update ( { #NEWLINE# #INDENT# 'tenant' : { #NEWLINE# #INDENT# 'zones' : [ zone ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# scenario = basic . DesignateBasic ( self . context ) #NEWLINE# recordsets_per_zone = 5 #NEWLINE# scenario . create_and_list_recordsets ( recordsets_per_zone = recordsets_per_zone ) #NEWLINE# self . assertEqual ( mock_designate_basic__create_recordset . mock_calls , ( [ mock . call ( zone , atomic_action = False ) ] * recordsets_per_zone ) ) #NEWLINE# mock_designate_basic__list_recordsets . assert_called_once_with ( zone [ 'id' ] )