"Fossies" - the Fresh Open Source Software Archive

Member "cloudkitty-9.0.0/cloudkitty/tests/api/v1/test_summary.py" (10 Apr 2019, 1289 Bytes) of package /linux/misc/openstack/cloudkitty-9.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test_summary.py": 8.0.0_vs_9.0.0.

    1 # -*- coding: utf-8 -*-
    2 # Copyright 2017 Objectif Libre
    3 #
    4 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    5 #    not use this file except in compliance with the License. You may obtain
    6 #    a copy of the License at
    7 #
    8 #         http://www.apache.org/licenses/LICENSE-2.0
    9 #
   10 #    Unless required by applicable law or agreed to in writing, software
   11 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   12 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   13 #    License for the specific language governing permissions and limitations
   14 #    under the License.
   15 #
   16 """Test SummaryModel objects."""
   17 from oslotest import base
   18 
   19 from cloudkitty.api.v1.datamodels import report
   20 
   21 
   22 class TestSummary(base.BaseTestCase):
   23 
   24     def setUp(self):
   25         super(TestSummary, self).setUp()
   26 
   27     def test_nulls(self):
   28         s = report.SummaryModel(begin=None,
   29                                 end=None,
   30                                 tenant_id=None,
   31                                 res_type=None,
   32                                 rate=None)
   33         self.assertIsNone(s.begin)
   34         self.assertIsNone(s.end)
   35         self.assertEqual(s.tenant_id, "ALL")
   36         self.assertEqual(s.res_type, "ALL")
   37         self.assertEqual(s.rate, "0")