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
|
"Missing '%s' element" % self.LBLIST_FIELD
|
||||||
).to_json()
|
).to_json()
|
||||||
|
|
||||||
lb_list = self.msg['loadbalancers']
|
lb_list = self.msg[self.LBLIST_FIELD]
|
||||||
|
|
||||||
for current_lb in lb_list:
|
for current_lb in lb_list:
|
||||||
if 'nodes' not in current_lb:
|
if 'nodes' not in current_lb:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class TestWorkerController(unittest.TestCase):
|
|||||||
def testUpdate(self):
|
def testUpdate(self):
|
||||||
msg = {
|
msg = {
|
||||||
c.ACTION_FIELD: 'UPDATE',
|
c.ACTION_FIELD: 'UPDATE',
|
||||||
'loadbalancers': [
|
'loadBalancers': [
|
||||||
{
|
{
|
||||||
'protocol': 'http',
|
'protocol': 'http',
|
||||||
'nodes': [
|
'nodes': [
|
||||||
@@ -83,7 +83,7 @@ class TestWorkerController(unittest.TestCase):
|
|||||||
def testCreateMissingNodes(self):
|
def testCreateMissingNodes(self):
|
||||||
msg = {
|
msg = {
|
||||||
c.ACTION_FIELD: 'UPDATE',
|
c.ACTION_FIELD: 'UPDATE',
|
||||||
'loadbalancers': [ { 'protocol': 'http' } ]
|
'loadBalancers': [ { 'protocol': 'http' } ]
|
||||||
}
|
}
|
||||||
controller = c(self.logger, self.driver, msg)
|
controller = c(self.logger, self.driver, msg)
|
||||||
response = controller.run()
|
response = controller.run()
|
||||||
@@ -92,7 +92,7 @@ class TestWorkerController(unittest.TestCase):
|
|||||||
def testCreateMissingProto(self):
|
def testCreateMissingProto(self):
|
||||||
msg = {
|
msg = {
|
||||||
c.ACTION_FIELD: 'UPDATE',
|
c.ACTION_FIELD: 'UPDATE',
|
||||||
'loadbalancers': [
|
'loadBalancers': [
|
||||||
{
|
{
|
||||||
'nodes': [
|
'nodes': [
|
||||||
{
|
{
|
||||||
@@ -110,7 +110,7 @@ class TestWorkerController(unittest.TestCase):
|
|||||||
def testBadAlgorithm(self):
|
def testBadAlgorithm(self):
|
||||||
msg = {
|
msg = {
|
||||||
c.ACTION_FIELD: 'UPDATE',
|
c.ACTION_FIELD: 'UPDATE',
|
||||||
'loadbalancers': [
|
'loadBalancers': [
|
||||||
{
|
{
|
||||||
'protocol': 'http',
|
'protocol': 'http',
|
||||||
'algorithm': 'BOGUS',
|
'algorithm': 'BOGUS',
|
||||||
|
|||||||
Reference in New Issue
Block a user