From e9c206af2af6f36fc621426bf4418f9d8ee2957a Mon Sep 17 00:00:00 2001 From: Dao Cong Tien Date: Wed, 31 Aug 2016 10:32:05 +0700 Subject: [PATCH] Remove unused source file tests/unit/db/fakes.py Change-Id: Ie880dca06c1b6aecd77d64cf738ee6f34ad9538e --- cinder/tests/unit/db/fakes.py | 44 ----------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 cinder/tests/unit/db/fakes.py diff --git a/cinder/tests/unit/db/fakes.py b/cinder/tests/unit/db/fakes.py deleted file mode 100644 index 90b90324cc9..00000000000 --- a/cinder/tests/unit/db/fakes.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. -# Copyright 2010 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""Stubouts, mocks and fixtures for the test suite.""" - -from cinder import db - - -class FakeModel(object): - """Stubs out for model.""" - def __init__(self, values): - self.values = values - - def __getattr__(self, name): - return self.values[name] - - def __getitem__(self, key): - if key in self.values: - return self.values[key] - else: - raise NotImplementedError() - - def __repr__(self): - return '' % self.values - - -def stub_out(stubs, funcs): - """Set the stubs in mapping in the db api.""" - for func in funcs: - func_name = '_'.join(func.__name__.split('_')[1:]) - stubs.Set(db, func_name, func)