~ubuntu-branches/ubuntu/utopic/horizon/utopic

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/admin/aggregates/tests.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-07-25 11:39:09 UTC
  • mfrom: (1.1.42)
  • Revision ID: package-import@ubuntu.com-20140725113909-b8920pdy87itn1ro
Tags: 1:2014.2~b2-0ubuntu1
* New upstream release.
* debian/patches/ubuntu_settings.patch: Refresed
* debian/patches/fix-dashboard-manage.patch: Refreshed
* debian/patches/fix-dashboard-django-wsgi.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
                compute_hosts.append(host)
123
123
 
124
124
        for host in compute_hosts:
125
 
            api.nova.add_host_to_aggregate(IsA(http.HttpRequest),
126
 
                                           aggregate.id, host.host_name)
 
125
            api.nova.add_host_to_aggregate(
 
126
                IsA(http.HttpRequest),
 
127
                aggregate.id, host.host_name).InAnyOrder()
127
128
 
128
129
        self.mox.ReplayAll()
129
130
 
246
247
 
247
248
        api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
248
249
                                            str(aggregate.id),
249
 
                                            'host2')
 
250
                                            'host2').InAnyOrder()
250
251
        api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
251
252
                                            str(aggregate.id),
252
 
                                            'host1')
 
253
                                            'host1').InAnyOrder()
253
254
        api.nova.aggregate_get(IsA(http.HttpRequest), str(aggregate.id)) \
254
255
                .AndReturn(aggregate)
255
256
        api.nova.host_list(IsA(http.HttpRequest)) \
279
280
                     [host1.host_name, host3.host_name]}
280
281
 
281
282
        api.nova.aggregate_get(IsA(http.HttpRequest), str(aggregate.id)) \
282
 
                .AndReturn(aggregate)
 
283
                .InAnyOrder().AndReturn(aggregate)
283
284
        api.nova.host_list(IsA(http.HttpRequest)) \
284
 
                .AndReturn(self.hosts.list())
 
285
                .InAnyOrder().AndReturn(self.hosts.list())
285
286
        api.nova.aggregate_get(IsA(http.HttpRequest), str(aggregate.id)) \
286
 
                .AndReturn(aggregate)
 
287
                .InAnyOrder().AndReturn(aggregate)
287
288
        api.nova.add_host_to_aggregate(IsA(http.HttpRequest),
288
 
                                       str(aggregate.id), host3.host_name)\
289
 
                .AndRaise(self.exceptions.nova)
 
289
                                       str(aggregate.id), host3.host_name) \
 
290
                .InAnyOrder().AndRaise(self.exceptions.nova)
290
291
        self.mox.ReplayAll()
291
292
 
292
293
        res = self.client.post(reverse(constants.AGGREGATES_MANAGE_HOSTS_URL,
302
303
                                   'host_list')})
303
304
    def test_manage_hosts_update_clean_not_empty_aggregate_should_fail(self):
304
305
        aggregate = self.aggregates.first()
305
 
        aggregate.hosts = ['host1', 'host2', 'host3']
 
306
        aggregate.hosts = ['host2']
306
307
        form_data = {'manageaggregatehostsaction_role_member':
307
308
                     []}
308
309
 
309
310
        api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
310
311
                                            str(aggregate.id),
311
 
                                            'host3')
312
 
        api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
313
 
                                            str(aggregate.id),
314
312
                                            'host2')\
315
313
                .AndRaise(self.exceptions.nova)
316
314
        api.nova.aggregate_get(IsA(http.HttpRequest), str(aggregate.id)) \
341
339
        if cleanAggregates:
342
340
            api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
343
341
                                                str(aggregate.id),
344
 
                                                'host3')
345
 
            api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
346
 
                                                str(aggregate.id),
347
 
                                                'host2')
348
 
            api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
349
 
                                                str(aggregate.id),
350
 
                                                'host1')
 
342
                                                'host3').InAnyOrder()
 
343
            api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
 
344
                                                str(aggregate.id),
 
345
                                                'host2').InAnyOrder()
 
346
            api.nova.remove_host_from_aggregate(IsA(http.HttpRequest),
 
347
                                                str(aggregate.id),
 
348
                                                'host1').InAnyOrder()
351
349
        api.nova.aggregate_get(IsA(http.HttpRequest), str(aggregate.id)) \
352
350
                .AndReturn(aggregate)
353
351
        api.nova.host_list(IsA(http.HttpRequest)) \