Add unit tests for L7Policy API

Note: The only lines not tested in this have to do with the _lookup
method for manipulating L7 rules. Hence the reason the unit test here
ended up in the l7rule.py test file.

Closes-Bug: #1549003
Change-Id: I0c7325a7a974be51d4c57c3d430cad959a09250e
This commit is contained in:
Stephen Balukoff 2016-03-07 14:59:10 -08:00
parent df5f907185
commit f6b527b32a

@ -46,6 +46,13 @@ class TestL7Rule(base.BaseAPITest):
response_body = response.json
self.assertEqual(l7rule, response_body)
def test_get_bad_parent_policy(self):
bad_path = (self.L7RULES_PATH.format(
lb_id=self.lb.get('id'), listener_id=self.listener.get('id'),
l7policy_id=uuidutils.generate_uuid()) + '/' +
uuidutils.generate_uuid())
self.get(bad_path, status=404)
def test_bad_get(self):
self.get(self.l7rule_path.format(
l7rule_id=uuidutils.generate_uuid()), status=404)