~ubuntu-cloud-archive/ubuntu/precise/python-novaclient/trunk

« back to all changes in this revision

Viewing changes to tests/v1_1/test_flavors.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Soren Hansen, Chuck Short
  • Date: 2012-09-07 18:32:24 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20120907183224-5derwehm2omeiu0b
Tags: 1:2.8.0.5-0ubuntu1
[ Adam Gandelman ]
* debian/control: Add python-iso8601.

[ Soren Hansen ]
* Update debian/watch to account for symbolically named tarballs and
  use newer URL.
* Fix Launchpad URLs in debian/watch.

[ Chuck Short ]
* New usptream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        self.assertEqual(f.ram, 256)
27
27
        self.assertEqual(f.disk, 10)
28
28
        self.assertEqual(f.ephemeral, 10)
 
29
        self.assertEqual(f.is_public, True)
29
30
 
30
31
    def test_get_flavor_details_diablo(self):
31
32
        f = cs.flavors.get(3)
34
35
        self.assertEqual(f.ram, 256)
35
36
        self.assertEqual(f.disk, 10)
36
37
        self.assertEqual(f.ephemeral, 'N/A')
 
38
        self.assertEqual(f.is_public, 'N/A')
37
39
 
38
40
    def test_find(self):
39
41
        f = cs.flavors.find(ram=256)
46
48
        self.assertRaises(exceptions.NotFound, cs.flavors.find, disk=12345)
47
49
 
48
50
    def test_create(self):
49
 
        f = cs.flavors.create("flavorcreate", 512, 1, 10, 1234, ephemeral=10)
 
51
        f = cs.flavors.create("flavorcreate", 512, 1, 10, 1234, ephemeral=10,
 
52
                              is_public=False)
50
53
 
51
54
        body = {
52
55
            "flavor": {
58
61
                "id": 1234,
59
62
                "swap": 0,
60
63
                "rxtx_factor": 1,
 
64
                "os-flavor-access:is_public": False,
61
65
            }
62
66
        }
63
67
 
64
68
        cs.assert_called('POST', '/flavors', body)
65
69
        self.assertTrue(isinstance(f, flavors.Flavor))
66
70
 
67
 
    def test_create_ephemeral_defaults_to_zero(self):
 
71
    def test_create_ephemeral_ispublic_defaults(self):
68
72
        f = cs.flavors.create("flavorcreate", 512, 1, 10, 1234)
69
73
 
70
74
        body = {
77
81
                "id": 1234,
78
82
                "swap": 0,
79
83
                "rxtx_factor": 1,
 
84
                "os-flavor-access:is_public": True,
80
85
            }
81
86
        }
82
87