~ubuntu-branches/ubuntu/vivid/horizon/vivid-proposed

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Chuck Short, Corey Bryant, James Page
  • Date: 2015-01-05 16:42:06 UTC
  • mfrom: (0.9.1) (1.2.5)
  • Revision ID: package-import@ubuntu.com-20150105164206-zrt2q64h4weugkur
Tags: 1:2015.1~b1-0ubuntu1
[ Chuck Short ]
* Open for Kilo.
* d/control: Update bzr branches 
* d/patches/embedded-xstatic.patch: Refreshed
* d/patches/add-juju-environment-download.patch: Temporarily disabled.

[ Corey Bryant ]
* New upstream release.
  - d/control: Align requirements with upstream.
  - d/watch: Update uversionmangle for kilo beta naming.
* d/control: Bumped Standards-Version to 3.9.6.

[ James Page ]
* d/bundle-xstatic.sh: Tweak grep to be case insensitive.
* d/p/add-juju-environment-download.patch: Rebase for kilo-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    def test_update_security_groups_get(self):
82
82
        sec_group = self.security_groups.first()
83
83
        api.network.security_group_get(IsA(http.HttpRequest),
84
 
                                        sec_group.id).AndReturn(sec_group)
 
84
                                       sec_group.id).AndReturn(sec_group)
85
85
        self.mox.ReplayAll()
86
86
 
87
87
        res = self.client.get(reverse('horizon:project:access_and_security:'
88
88
                                      'security_groups:update',
89
89
                                      args=[sec_group.id]))
90
 
        self.assertTemplateUsed(res,
91
 
                'project/access_and_security/security_groups/_update.html')
 
90
        self.assertTemplateUsed(
 
91
            res, 'project/access_and_security/security_groups/_update.html')
92
92
        self.assertEqual(res.context['security_group'].name,
93
93
                         sec_group.name)
94
94
 
97
97
    def test_update_security_groups_post(self):
98
98
        sec_group = self.security_groups.get(name="other_group")
99
99
        api.network.security_group_update(IsA(http.HttpRequest),
100
 
                                       str(sec_group.id),
101
 
                                       sec_group.name,
102
 
                                       sec_group.description) \
 
100
                                          str(sec_group.id),
 
101
                                          sec_group.name,
 
102
                                          sec_group.description) \
103
103
            .AndReturn(sec_group)
104
104
        api.network.security_group_get(IsA(http.HttpRequest),
105
 
                                        sec_group.id).AndReturn(sec_group)
 
105
                                       sec_group.id).AndReturn(sec_group)
106
106
        self.mox.ReplayAll()
107
107
 
108
108
        formData = {'method': 'UpdateGroup',
118
118
 
119
119
    def test_create_security_groups_get(self):
120
120
        res = self.client.get(SG_CREATE_URL)
121
 
        self.assertTemplateUsed(res,
122
 
                    'project/access_and_security/security_groups/create.html')
 
121
        self.assertTemplateUsed(
 
122
            res, 'project/access_and_security/security_groups/create.html')
123
123
 
124
124
    @test.create_stubs({api.network: ('security_group_create',)})
125
125
    def test_create_security_groups_post(self):
126
126
        sec_group = self.security_groups.first()
127
127
        api.network.security_group_create(IsA(http.HttpRequest),
128
 
                                       sec_group.name,
129
 
                                       sec_group.description) \
 
128
                                          sec_group.name,
 
129
                                          sec_group.description) \
130
130
            .AndReturn(sec_group)
131
131
        self.mox.ReplayAll()
132
132
 
140
140
    def test_create_security_groups_post_exception(self):
141
141
        sec_group = self.security_groups.first()
142
142
        api.network.security_group_create(IsA(http.HttpRequest),
143
 
                                       sec_group.name,
144
 
                                       sec_group.description) \
 
143
                                          sec_group.name,
 
144
                                          sec_group.description) \
145
145
            .AndRaise(self.exceptions.nova)
146
146
        self.mox.ReplayAll()
147
147
 
162
162
                    'name': fail_name,
163
163
                    'description': sec_group.description}
164
164
        res = self.client.post(SG_CREATE_URL, formData)
165
 
        self.assertTemplateUsed(res,
166
 
                    'project/access_and_security/security_groups/create.html')
 
165
        self.assertTemplateUsed(
 
166
            res, 'project/access_and_security/security_groups/create.html')
167
167
        self.assertContains(res, "ASCII")
168
168
 
169
169
    @test.create_stubs({api.network: ('security_group_get',)})
174
174
                                       sec_group.id).AndReturn(sec_group)
175
175
        self.mox.ReplayAll()
176
176
        res = self.client.get(self.detail_url)
177
 
        self.assertTemplateUsed(res,
178
 
                'project/access_and_security/security_groups/detail.html')
 
177
        self.assertTemplateUsed(
 
178
            res, 'project/access_and_security/security_groups/detail.html')
179
179
 
180
180
    @test.create_stubs({api.network: ('security_group_get',)})
181
181
    def test_detail_get_exception(self):
182
182
        sec_group = self.security_groups.first()
183
183
 
184
184
        api.network.security_group_get(IsA(http.HttpRequest),
185
 
                                    sec_group.id) \
186
 
                .AndRaise(self.exceptions.nova)
 
185
                                       sec_group.id) \
 
186
            .AndRaise(self.exceptions.nova)
187
187
 
188
188
        self.mox.ReplayAll()
189
189