"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cloudkitty/tests/collectors/test_gnocchi.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_gnocchi.py  (cloudkitty-8.0.0):test_gnocchi.py  (cloudkitty-9.0.0)
skipping to change at line 17 skipping to change at line 17
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# 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.
# #
# #
import testtools
from cloudkitty.collector import gnocchi from cloudkitty.collector import gnocchi
from cloudkitty import tests from cloudkitty import tests
from cloudkitty.tests import samples from cloudkitty.tests import samples
from cloudkitty.tests.utils import is_functional_test from cloudkitty import transformer
@testtools.skipIf(is_functional_test(), 'Not a functional test')
class GnocchiCollectorTest(tests.TestCase): class GnocchiCollectorTest(tests.TestCase):
def setUp(self): def setUp(self):
super(GnocchiCollectorTest, self).setUp() super(GnocchiCollectorTest, self).setUp()
self._tenant_id = samples.TENANT self._tenant_id = samples.TENANT
self.collector = gnocchi.GnocchiCollector self.conf.set_override('collector', 'gnocchi', 'collect')
self.conf.set_override(
'gnocchi_auth_type', 'basic', 'collector_gnocchi')
self.collector = gnocchi.GnocchiCollector(
transformer.get_transformers(),
period=3600,
conf=samples.DEFAULT_METRICS_CONF,
)
def test_format_data_raises_exception(self):
metconf = {'extra_args': {'resource_key': 'id'}}
data = {'group': {'id': '281b9dc6-5d02-4610-af2d-10d0d6887f48'}}
self.assertRaises(
gnocchi.AssociatedResourceNotFound,
self.collector._format_data,
metconf,
data,
resources_info={},
)
# Filter generation # Filter generation
def test_generate_one_field_filter(self): def test_generate_one_field_filter(self):
actual = self.collector.gen_filter(value1=2) actual = self.collector.gen_filter(value1=2)
expected = { expected = {
'=': { '=': {
'value1': 2 'value1': 2
}} }}
self.assertEqual(expected, actual) self.assertEqual(expected, actual)
 End of changes. 4 change blocks. 
5 lines changed or deleted 21 lines changed or added

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