"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cloudkitty/tests/storage/v1/test_hybrid_storage.py" between
cloudkitty-8.0.0.tar.gz and cloudkitty-9.0.0.tar.gz

About: OpenStack CloudKitty provides Rating-as-a-Service for OpenStack.
The "Stein" series (latest release).

test_hybrid_storage.py  (cloudkitty-8.0.0):test_hybrid_storage.py  (cloudkitty-9.0.0)
skipping to change at line 19 skipping to change at line 19
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
# #
# @author: Luka Peschke # @author: Luka Peschke
# #
import mock import mock
import testtools
from gnocchiclient import exceptions as gexc from gnocchiclient import exceptions as gexc
from cloudkitty import storage from cloudkitty import storage
from cloudkitty import tests from cloudkitty import tests
from cloudkitty.tests import test_utils from cloudkitty.tests import utils as test_utils
from cloudkitty.tests.utils import is_functional_test
class BaseHybridStorageTest(tests.TestCase): class BaseHybridStorageTest(tests.TestCase):
@mock.patch('cloudkitty.utils.load_conf', new=test_utils.load_conf) @mock.patch('cloudkitty.utils.load_conf', new=test_utils.load_conf)
def setUp(self): def setUp(self):
super(BaseHybridStorageTest, self).setUp() super(BaseHybridStorageTest, self).setUp()
self.conf.set_override('backend', 'hybrid', 'storage') self.conf.set_override('backend', 'hybrid', 'storage')
self.conf.set_override('version', '1', 'storage') self.conf.set_override('version', '1', 'storage')
self.storage = storage.get_storage(conf=test_utils.load_conf()) self.storage = storage.get_storage(conf=test_utils.load_conf())
with mock.patch.object( with mock.patch.object(
skipping to change at line 56 skipping to change at line 54
>>> checker == mydict >>> checker == mydict
True True
""" """
def __init__(self, value, key='name'): def __init__(self, value, key='name'):
self.key = key self.key = key
self.value = value self.value = value
def __eq__(self, other): def __eq__(self, other):
return self.value == other.get(self.key) return self.value == other.get(self.key)
@testtools.skipIf(is_functional_test(), 'Not a functional test')
class HybridStorageTestGnocchi(BaseHybridStorageTest): class HybridStorageTestGnocchi(BaseHybridStorageTest):
def setUp(self): def setUp(self):
super(HybridStorageTestGnocchi, self).setUp() super(HybridStorageTestGnocchi, self).setUp()
def tearDown(self): def tearDown(self):
super(HybridStorageTestGnocchi, self).tearDown() super(HybridStorageTestGnocchi, self).tearDown()
def _init_storage(self, archive_policy=False, res_type=False): def _init_storage(self, archive_policy=False, res_type=False):
with mock.patch.object(self.storage.storage._hybrid_backend._conn, with mock.patch.object(self.storage.storage._hybrid_backend._conn,
 End of changes. 3 change blocks. 
4 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)