<s> import mock <EOL> from rally . plugins . openstack . scenarios . ceilometer import events <EOL> from tests . unit import test <EOL> class CeilometerEventsTestCase ( test . ScenarioTestCase ) : <EOL> def test_list_events ( self ) : <EOL> scenario = events . CeilometerEvents ( self . context ) <EOL> scenario . _user_create = mock . MagicMock ( ) <EOL> scenario . _list_events = mock . MagicMock ( ) <EOL> scenario . create_user_and_list_events ( ) <EOL> scenario . _user_create . assert_called_once_with ( ) <EOL> scenario . _list_events . assert_called_once_with ( ) <EOL> def test_list_event_types ( self ) : <EOL> scenario = events . CeilometerEvents ( self . context ) <EOL> scenario . _list_event_types = mock . MagicMock ( ) <EOL> scenario . _user_create = mock . MagicMock ( ) <EOL> scenario . create_user_and_list_event_types ( ) <EOL> scenario . _user_create . assert_called_once_with ( ) <EOL> scenario . _list_event_types . assert_called_once_with ( ) <EOL> def test_get_event ( self ) : <EOL> scenario = events . CeilometerEvents ( self . context ) <EOL> scenario . _user_create = mock . MagicMock ( ) <EOL> scenario . _list_events = mock . MagicMock ( ) <EOL> scenario . _get_event = mock . MagicMock ( ) <EOL> scenario . _list_events . return_value = [ mock . Mock ( message_id = "<STR_LIT>" ) ] <EOL> scenario . create_user_and_get_event ( ) <EOL> scenario . _user_create . assert_called_once_with ( ) <EOL> scenario . _list_events . assert_called_with ( ) <EOL> scenario . _get_event . assert_called_with ( event_id = "<STR_LIT>" ) </s>
