"Fossies" - the Fresh Open Source Software Archive

Member "neutron-14.0.3/neutron/tests/unit/db/test_segments_db.py" (22 Oct 2019, 1011 Bytes) of package /linux/misc/openstack/neutron-14.0.3.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.

    1 # Copyright (c) 2016 IBM Corp.
    2 #
    3 # All Rights Reserved.
    4 #
    5 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    6 #    not use this file except in compliance with the License. You may obtain
    7 #    a copy of the License at
    8 #
    9 #         http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 #    Unless required by applicable law or agreed to in writing, software
   12 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14 #    License for the specific language governing permissions and limitations
   15 #    under the License.
   16 
   17 import mock
   18 
   19 from neutron.db import segments_db
   20 from neutron.tests import base
   21 
   22 
   23 class TestSegmentsDb(base.BaseTestCase):
   24 
   25     def test_get_networks_segments_with_empty_networks(self):
   26         context = mock.MagicMock()
   27         net_segs = segments_db.get_networks_segments(context, [])
   28         self.assertFalse(context.session.query.called)
   29         self.assertEqual({}, net_segs)