Exemplo n.º 1
0
    def test_list_events(self):
        scenario = events.CeilometerEventsCreateUserAndListEvents(self.context)

        scenario._user_create = mock.MagicMock()
        scenario._list_events = mock.MagicMock()
        scenario.run()
        scenario._user_create.assert_called_once_with()
        scenario._list_events.assert_called_once_with()
Exemplo n.º 2
0
    def test_list_events_fails(self):
        scenario = events.CeilometerEventsCreateUserAndListEvents(self.context)

        scenario._list_events = mock.MagicMock(return_value=[])

        self.assertRaises(exceptions.RallyException, scenario.run)

        self.mock_identity.return_value.create_user.assert_called_once_with()
        scenario._list_events.assert_called_once_with()
Exemplo n.º 3
0
    def test_list_events(self):
        scenario = events.CeilometerEventsCreateUserAndListEvents(self.context)

        scenario._list_events = mock.MagicMock()

        scenario.run()

        self.mock_identity.return_value.create_user.assert_called_once_with()
        scenario._list_events.assert_called_once_with()