def setUp(self):
     super(CellsExtensionTests, self).setUp()
     extensions = [
         extension.Extension(cells.__name__.split(".")[-1],
                             cells),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)
 def setUp(self):
     super(ServerExternalEventsTestCase, self).setUp()
     extensions = [
         extension.Extension(
             ext_events.__name__.split(".")[-1], ext_events),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)
 def setUp(self):
     super(InstanceActionExtensionTests, self).setUp()
     extensions = [
         extension.Extension(
             instance_action.__name__.split(".")[-1], instance_action),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)
Esempio n. 4
0
 def setUp(self):
     super(AssistedVolumeSnapshotsTestCase, self).setUp()
     extensions = [
         extension.Extension(
             assisted_snaps.__name__.split(".")[-1], assisted_snaps),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)
Esempio n. 5
0
 def setUp(self):
     super(TenantNetworkExtensionTests, self).setUp()
     extensions = [
         extension.Extension(tenant_networks.__name__.split(".")[-1],
                             tenant_networks),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)
Esempio n. 6
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.

from novaclient import extension
from novaclient.tests.unit import utils
from novaclient.tests.unit.v2.contrib import fakes
from novaclient.v2.contrib import cells

extensions = [
    extension.Extension(cells.__name__.split(".")[-1], cells),
]
cs = fakes.FakeClient(extensions=extensions)


class CellsExtensionTests(utils.TestCase):
    def test_get_cells(self):
        cell_name = 'child_cell'
        cs.cells.get(cell_name)
        cs.assert_called('GET', '/os-cells/%s' % cell_name)

    def test_get_capacities_for_a_given_cell(self):
        cell_name = 'child_cell'
        cs.cells.capacities(cell_name)
        cs.assert_called('GET', '/os-cells/%s/capacities' % cell_name)

    def test_get_capacities_for_all_cells(self):
        cs.cells.capacities()
 def setUp(self):
     super(BaremetalExtensionTest, self).setUp()
     extensions = [
         extension.Extension(baremetal.__name__.split(".")[-1], baremetal),
     ]
     self.cs = fakes.FakeClient(extensions=extensions)