~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/compute/contrib/test_flavor_manage.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        'extra_specs': {},
47
47
        'deleted_at': None,
48
48
        'vcpu_weight': None,
49
 
        'id': 7
 
49
        'id': 7,
 
50
        'is_public': True
50
51
    }
51
52
 
52
53
 
55
56
 
56
57
 
57
58
def fake_create(name, memory_mb, vcpus, root_gb, ephemeral_gb,
58
 
                flavorid, swap, rxtx_factor):
 
59
                flavorid, swap, rxtx_factor, is_public):
59
60
    newflavor = fake_get_instance_type_by_flavor_id(flavorid)
60
61
 
61
62
    newflavor["name"] = name
65
66
    newflavor["ephemeral_gb"] = int(ephemeral_gb)
66
67
    newflavor["swap"] = swap
67
68
    newflavor["rxtx_factor"] = float(rxtx_factor)
 
69
    newflavor["is_public"] = bool(is_public)
68
70
 
69
71
    return newflavor
70
72
 
100
102
                "id": 1234,
101
103
                "swap": 512,
102
104
                "rxtx_factor": 1,
 
105
                "os-flavor-access:is_public": True,
103
106
            }
104
107
        }
105
108
 
124
127
                "id": 1235,
125
128
                "swap": 512,
126
129
                "rxtx_factor": 1,
 
130
                "os-flavor-access:is_public": True,
127
131
            }
128
132
        }
129
133
 
130
134
        def fake_create(name, memory_mb, vcpus, root_gb, ephemeral_gb,
131
 
                        flavorid, swap, rxtx_factor):
 
135
                        flavorid, swap, rxtx_factor, is_public):
132
136
            raise exception.InstanceTypeExists()
133
137
 
134
138
        self.stubs.Set(instance_types, "create", fake_create)