Change to test JSON msgs are case-insensitive.

Fix hard coded use of load balancer list name field. Also make
sure our tests use a mixed case version of this field name to
verify we still recognize it properly.

Change-Id: I48954f619dab8df85339b65495b342a52edfead1
This commit is contained in:
David Shrewsbury
2012-12-17 08:53:49 -05:00
parent eb482aecfd
commit 445496a276
2 changed files with 5 additions and 5 deletions

View File

@@ -105,7 +105,7 @@ class LBaaSController(object):
"Missing '%s' element" % self.LBLIST_FIELD
).to_json()
lb_list = self.msg['loadbalancers']
lb_list = self.msg[self.LBLIST_FIELD]
for current_lb in lb_list:
if 'nodes' not in current_lb:

View File

@@ -28,7 +28,7 @@ class TestWorkerController(unittest.TestCase):
def testUpdate(self):
msg = {
c.ACTION_FIELD: 'UPDATE',
'loadbalancers': [
'loadBalancers': [
{
'protocol': 'http',
'nodes': [
@@ -83,7 +83,7 @@ class TestWorkerController(unittest.TestCase):
def testCreateMissingNodes(self):
msg = {
c.ACTION_FIELD: 'UPDATE',
'loadbalancers': [ { 'protocol': 'http' } ]
'loadBalancers': [ { 'protocol': 'http' } ]
}
controller = c(self.logger, self.driver, msg)
response = controller.run()
@@ -92,7 +92,7 @@ class TestWorkerController(unittest.TestCase):
def testCreateMissingProto(self):
msg = {
c.ACTION_FIELD: 'UPDATE',
'loadbalancers': [
'loadBalancers': [
{
'nodes': [
{
@@ -110,7 +110,7 @@ class TestWorkerController(unittest.TestCase):
def testBadAlgorithm(self):
msg = {
c.ACTION_FIELD: 'UPDATE',
'loadbalancers': [
'loadBalancers': [
{
'protocol': 'http',
'algorithm': 'BOGUS',