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

« back to all changes in this revision

Viewing changes to ceilometer/tests/image/test_glance.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 2012 New Dream Network, LLC (DreamHost)
3
3
#
4
 
# Author: Julien Danjou <julien@danjou.info>
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
16
14
# under the License.
17
15
 
18
16
import mock
19
 
from oslo.config import fixture as fixture_config
 
17
from oslo_config import fixture as fixture_config
 
18
from oslo_context import context
20
19
from oslotest import base
21
20
from oslotest import mockpatch
22
21
 
23
22
from ceilometer.agent import manager
24
23
from ceilometer.image import glance
25
 
from ceilometer.openstack.common import context
26
24
 
27
25
IMAGE_LIST = [
28
26
    type('Image', (object,),
127
125
 
128
126
class TestImagePollsterPageSize(base.BaseTestCase):
129
127
 
130
 
    def fake_get_glance_client(self, ksclient, endpoint):
 
128
    @staticmethod
 
129
    def fake_get_glance_client(ksclient, endpoint):
131
130
        glanceclient = FakeGlanceClient()
132
131
        glanceclient.images.list = mock.MagicMock(return_value=IMAGE_LIST)
133
132
        return glanceclient
165
164
 
166
165
class TestImagePollster(base.BaseTestCase):
167
166
 
168
 
    def fake_get_glance_client(self, ksclient, endpoint):
 
167
    @staticmethod
 
168
    def fake_get_glance_client(ksclient, endpoint):
169
169
        glanceclient = _BaseObject()
170
170
        setattr(glanceclient, "images", _BaseObject())
171
171
        setattr(glanceclient.images,