1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2012 United States Government as represented by the
4
# Administrator of the National Aeronautics and Space Administration.
7
# Copyright 2012 Nebula, Inc.
9
# Licensed under the Apache License, Version 2.0 (the "License"); you may
10
# not use this file except in compliance with the License. You may obtain
11
# a copy of the License at
13
# http://www.apache.org/licenses/LICENSE-2.0
15
# Unless required by applicable law or agreed to in writing, software
16
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18
# License for the specific language governing permissions and limitations
21
from django import http
22
from django.core.urlresolvers import reverse
25
from horizon import api
26
from horizon import test
29
class VolumeViewTests(test.TestCase):
30
def test_edit_attachments(self):
31
volume = self.volumes.first()
32
servers = self.servers.list()
33
self.mox.StubOutWithMock(api, 'volume_get')
34
self.mox.StubOutWithMock(api.nova, 'server_list')
35
api.volume_get(IsA(http.HttpRequest), volume.id) \
37
api.nova.server_list(IsA(http.HttpRequest)).AndReturn(servers)
40
url = reverse('horizon:nova:instances_and_volumes:volumes:attach',
42
res = self.client.get(url)
43
self.assertEqual(res.status_code, 200)