~ubuntu-branches/ubuntu/vivid/ceilometer/vivid

« back to all changes in this revision

Viewing changes to ceilometer/tests/event/test_converter.py

  • Committer: Package Import Robot
  • Author(s): James Page, Corey Bryant, James Page
  • Date: 2015-02-19 14:59:07 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20150219145907-9jojybdsl64zcn14
Tags: 2015.1~b2-0ubuntu1
[ Corey Bryant ]
* New upstream release.
  - d/control: Align requirements with upstream.
  - d/p/skip-test.patch: Rebased.

[ James Page ]
* d/rules,d/p/skip-gabbi.patch: Skip tests that rely on python-gabbi until
  packaging and MIR is complete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
# Copyright 2013 Rackspace Hosting.
3
3
#
4
 
# Author: Monsyne Dragon <mdragon@rackspace.com>
5
 
#
6
4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
5
# not use this file except in compliance with the License. You may obtain
8
6
# a copy of the License at
19
17
 
20
18
import jsonpath_rw
21
19
import mock
22
 
from oslo.config import cfg as oslo_cfg
 
20
from oslo_config import cfg as oslo_cfg
23
21
import six
24
22
 
25
23
from ceilometer.event import converter
28
26
 
29
27
 
30
28
class ConverterBase(base.BaseTestCase):
31
 
    def _create_test_notification(self, event_type, message_id, **kw):
 
29
    @staticmethod
 
30
    def _create_test_notification(event_type, message_id, **kw):
32
31
        return dict(event_type=event_type,
33
32
                    message_id=message_id,
34
33
                    priority="INFO",
546
545
        edef = converter.EventDefinition(cfg, self.fake_plugin_mgr)
547
546
        self.assertTrue(edef.is_catchall)
548
547
 
549
 
    @mock.patch('oslo.utils.timeutils.utcnow')
 
548
    @mock.patch('oslo_utils.timeutils.utcnow')
550
549
    def test_extract_when(self, mock_utcnow):
551
550
        now = datetime.datetime.utcnow()
552
551
        modified = now + datetime.timedelta(minutes=1)
623
622
            host='cydonia')
624
623
        self.fake_plugin_mgr = {}
625
624
 
626
 
    @mock.patch('oslo.utils.timeutils.utcnow')
 
625
    @mock.patch('oslo_utils.timeutils.utcnow')
627
626
    def test_converter_missing_keys(self, mock_utcnow):
628
627
        # test a malformed notification
629
628
        now = datetime.datetime.utcnow()