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

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/project/data_processing/clusters/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:
31
31
            .AndReturn(self.clusters.list())
32
32
        self.mox.ReplayAll()
33
33
        res = self.client.get(INDEX_URL)
34
 
        self.assertTemplateUsed(res,
35
 
            'project/data_processing.clusters/clusters.html')
 
34
        self.assertTemplateUsed(
 
35
            res, 'project/data_processing.clusters/clusters.html')
36
36
        self.assertContains(res, 'Clusters')
37
37
        self.assertContains(res, 'Name')
 
38
 
 
39
    @test.create_stubs({api.sahara: ('cluster_template_list', 'image_list')})
 
40
    def test_launch_cluster_get_nodata(self):
 
41
        api.sahara.cluster_template_list(IsA(http.HttpRequest)) \
 
42
            .AndReturn([])
 
43
        api.sahara.image_list(IsA(http.HttpRequest)) \
 
44
            .AndReturn([])
 
45
        self.mox.ReplayAll()
 
46
        url = reverse(
 
47
            'horizon:project:data_processing.clusters:configure-cluster')
 
48
        res = self.client.get("%s?plugin_name=shoes&hadoop_version=1.1" % url)
 
49
        self.assertContains(res, "No Images Available")
 
50
        self.assertContains(res, "No Templates Available")
 
51
 
 
52
    @test.create_stubs({api.sahara: ('cluster_list',
 
53
                                     'cluster_delete')})
 
54
    def test_delete(self):
 
55
        cluster = self.clusters.first()
 
56
        api.sahara.cluster_list(IsA(http.HttpRequest)) \
 
57
            .AndReturn(self.clusters.list())
 
58
        api.sahara.cluster_delete(IsA(http.HttpRequest), cluster.id)
 
59
        self.mox.ReplayAll()
 
60
 
 
61
        form_data = {'action': 'clusters__delete__%s' % cluster.id}
 
62
        res = self.client.post(INDEX_URL, form_data)
 
63
 
 
64
        self.assertNoFormErrors(res)
 
65
        self.assertRedirectsNoFollow(res, INDEX_URL)
 
66
        self.assertMessageCount(success=1)
 
 
b'\\ No newline at end of file'