<s> import mock <EOL> from rally . plugins . openstack . scenarios . mistral import workbooks <EOL> from tests . unit import test <EOL> MISTRAL_WBS = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> class MistralWorkbooksTestCase ( test . ScenarioTestCase ) : <EOL> @ mock . patch ( MISTRAL_WBS + "<STR_LIT>" ) <EOL> def test_list_workbooks ( self , mock__list_workbooks ) : <EOL> mistral_scenario = workbooks . MistralWorkbooks ( self . context ) <EOL> mistral_scenario . list_workbooks ( ) <EOL> mock__list_workbooks . assert_called_once_with ( ) <EOL> @ mock . patch ( MISTRAL_WBS + "<STR_LIT>" ) <EOL> def test_create_workbook ( self , mock__create_workbook ) : <EOL> mistral_scenario = workbooks . MistralWorkbooks ( self . context ) <EOL> definition = "<STR_LIT>" <EOL> fake_wb = mock . MagicMock ( ) <EOL> fake_wb . name = "<STR_LIT:wb>" <EOL> mock__create_workbook . return_value = fake_wb <EOL> mistral_scenario . create_workbook ( definition ) <EOL> self . assertEqual ( <NUM_LIT:1> , mock__create_workbook . called ) <EOL> @ mock . patch ( MISTRAL_WBS + "<STR_LIT>" ) <EOL> @ mock . patch ( MISTRAL_WBS + "<STR_LIT>" ) <EOL> def test_create_delete_workbook ( self , <EOL> mock__create_workbook , <EOL> mock__delete_workbook ) : <EOL> mistral_scenario = workbooks . MistralWorkbooks ( self . context ) <EOL> definition = "<STR_LIT>" <EOL> fake_wb = mock . MagicMock ( ) <EOL> fake_wb . name = "<STR_LIT:wb>" <EOL> mock__create_workbook . return_value = fake_wb <EOL> mistral_scenario . create_workbook ( definition , do_delete = True ) <EOL> self . assertEqual ( <NUM_LIT:1> , mock__create_workbook . called ) <EOL> mock__delete_workbook . assert_called_once_with ( fake_wb . name ) </s>
