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:
@@ -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:
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user