def test_flavor_delete(self): rc = self.tuskarclient_resource_classes.first() flavor = self.tuskarclient_flavors.first() tuskarclient = self.stub_tuskarclient() tuskarclient.flavors = self.mox.CreateMockAnything() tuskarclient.flavors.delete(rc.id, flavor.id) self.mox.ReplayAll() Flavor.delete(self.request, resource_class_id=rc.id, flavor_id=flavor.id)
def test_flavor_create(self): flavor = self.tuskarclient_flavors.first() tuskarclient = self.stub_tuskarclient() tuskarclient.flavors = self.mox.CreateMockAnything() tuskarclient.flavors.create(1, name='nano', max_vms=100, capacities=[]).AndReturn(flavor) self.mox.ReplayAll() ret_val = Flavor.create(self.request, resource_class_id=1, name='nano', max_vms=100, capacities=[]) self.assertIsInstance(ret_val, Flavor)