Add test for invalid action value.
This commit is contained in:
parent
983eb4a06b
commit
e36e4c1052
@ -83,6 +83,28 @@ class TestLBaaSTask(unittest.TestCase):
|
|||||||
self.assertIn("hpcs_response", r)
|
self.assertIn("hpcs_response", r)
|
||||||
self.assertEqual("FAIL", r["hpcs_response"])
|
self.assertEqual("FAIL", r["hpcs_response"])
|
||||||
|
|
||||||
|
def testInvalidAction(self):
|
||||||
|
""" Test invalid messages: invalid hpcs_action """
|
||||||
|
worker = FakeWorker()
|
||||||
|
data = {
|
||||||
|
"action": "invalid",
|
||||||
|
"name": "a-new-loadbalancer",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"address": "10.1.1.1",
|
||||||
|
"port": "80"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address": "10.1.1.2",
|
||||||
|
"port": "81"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
job = FakeJob(data)
|
||||||
|
r = lbaas_task(worker, job)
|
||||||
|
self.assertIn("hpcs_response", r)
|
||||||
|
self.assertEqual("FAIL", r["hpcs_response"])
|
||||||
|
|
||||||
def testMissingNodes(self):
|
def testMissingNodes(self):
|
||||||
""" Test invalid messages: missing nodes """
|
""" Test invalid messages: missing nodes """
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user