~ubuntu-branches/ubuntu/saucy/python-novaclient/saucy

« back to all changes in this revision

Viewing changes to tests/v1_1/test_flavors.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-02-03 10:46:49 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20120203104649-3604yixrglbsoi0g
Tags: 2012.1~e4~20120203.484-0ubuntu1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        self.assertEqual(f.name, '512 MB Server')
36
36
 
37
37
        self.assertRaises(exceptions.NotFound, cs.flavors.find, disk=12345)
 
38
 
 
39
    def test_create(self):
 
40
        f = cs.flavors.create("flavorcreate", 512, 1, 10, 1234)
 
41
 
 
42
        body = {
 
43
            "flavor": {
 
44
                "name": "flavorcreate",
 
45
                "ram": 512,
 
46
                "vcpus": 1,
 
47
                "disk": 10,
 
48
                "id": 1234,
 
49
                "swap": 0,
 
50
                "rxtx_factor": 1,
 
51
            }
 
52
        }
 
53
 
 
54
        cs.assert_called('POST', '/flavors', body)
 
55
        self.assertTrue(isinstance(f, flavors.Flavor))
 
56
 
 
57
    def test_delete(self):
 
58
        cs.flavors.delete("flavordelete")
 
59
        cs.assert_called('DELETE', '/flavors/flavordelete')