cleaned up instances of MultipleTimes
Change-Id: I9bae9e293fe9fccce0a722709945db8f8a2a09ea Implements: blueprint multiple-times-in-tests
This commit is contained in:
parent
1861547b72
commit
cffde007d0
@ -93,7 +93,7 @@ class RackViewTests(test.BaseAdminViewTests):
|
||||
rack = self.tuskar_racks.first()
|
||||
|
||||
tuskar.Rack.get(
|
||||
mox.IsA(http.HttpRequest), rack.id).MultipleTimes().AndReturn(rack)
|
||||
mox.IsA(http.HttpRequest), rack.id).AndReturn(rack)
|
||||
tuskar.ResourceClass.list(
|
||||
mox.IsA(http.request.HttpRequest)).AndReturn(
|
||||
self.tuskar_resource_classes.list())
|
||||
@ -126,7 +126,7 @@ class RackViewTests(test.BaseAdminViewTests):
|
||||
'cpus': u'1', 'memory_mb': u'1024', 'local_gb': u'10'}
|
||||
|
||||
tuskar.Rack.get(
|
||||
mox.IsA(http.HttpRequest), rack.id).MultipleTimes().AndReturn(rack)
|
||||
mox.IsA(http.HttpRequest), rack.id).AndReturn(rack)
|
||||
tuskar.Rack.list(
|
||||
mox.IsA(http.request.HttpRequest)).AndReturn(
|
||||
self.tuskar_racks.list())
|
||||
|
@ -126,8 +126,17 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).MultipleTimes().AndReturn(
|
||||
resource_class)
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
# get_flavors_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
# get_racks_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
@ -152,7 +161,7 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
resource_class = self.tuskar_resource_classes.first()
|
||||
|
||||
tuskar.ResourceClass.\
|
||||
get(mox.IsA(http.HttpRequest), resource_class.id).MultipleTimes()\
|
||||
get(mox.IsA(http.HttpRequest), resource_class.id)\
|
||||
.AndRaise(self.exceptions.tuskar)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
@ -263,7 +272,7 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest), resource_class.id).\
|
||||
MultipleTimes().AndReturn(resource_class)
|
||||
AndReturn(resource_class)
|
||||
self.mox.ReplayAll()
|
||||
|
||||
tuskar.ResourceClass.list_flavors = flavors
|
||||
@ -358,7 +367,7 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).\
|
||||
MultipleTimes().AndRaise(self.exceptions.tuskar)
|
||||
AndRaise(self.exceptions.tuskar)
|
||||
self.mox.ReplayAll()
|
||||
|
||||
url = urlresolvers.reverse(
|
||||
@ -379,7 +388,18 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
|
||||
tuskar.ResourceClass.get(mox.IsA(http.HttpRequest),
|
||||
resource_class.id).\
|
||||
MultipleTimes().AndReturn(resource_class)
|
||||
AndReturn(resource_class)
|
||||
|
||||
# get_flavors_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
# get_racks_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
# FIXME I should probably track the racks and flavors methods
|
||||
@ -448,7 +468,18 @@ class ResourceClassViewTests(test.BaseAdminViewTests):
|
||||
|
||||
tuskar.ResourceClass.get(mox.IsA(http.HttpRequest),
|
||||
resource_class.id).\
|
||||
MultipleTimes().AndReturn(resource_class)
|
||||
AndReturn(resource_class)
|
||||
|
||||
# get_flavors_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
# get_racks_data in workflows.py
|
||||
tuskar.ResourceClass.get(
|
||||
mox.IsA(http.HttpRequest),
|
||||
resource_class.id).AndReturn(resource_class)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
|
||||
# FIXME I should probably track the racks and flavors methods
|
||||
|
Loading…
Reference in New Issue
Block a user