Merge "Refactored filter implementation."

This commit is contained in:
Jenkins 2015-10-21 09:01:57 +00:00 committed by Gerrit Code Review
commit 34b1fa48e3
4 changed files with 9 additions and 9 deletions

View File

@ -35,8 +35,8 @@ class ListType(wtypes.UserType):
"""
items = [v.strip().lower() for v in six.text_type(value).split(',')]
# filter() to remove empty items.
return filter(None, items)
# remove empty items.
return [x for x in items if x]
@staticmethod
def frombasetype(value):

View File

@ -325,7 +325,7 @@ class TestActionsController(base.FunctionalTest):
self.assertIn(
"Length of sort_keys must be equal or greater than sort_dirs",
resp.body
resp.body.decode()
)
def test_get_all_pagination_unknown_direction(self):
@ -336,4 +336,4 @@ class TestActionsController(base.FunctionalTest):
self.assertEqual(400, resp.status_int)
self.assertIn("Unknown sort direction", resp.body)
self.assertIn("Unknown sort direction", resp.body.decode())

View File

@ -296,7 +296,7 @@ class TestExecutionsController(base.FunctionalTest):
self.assertIn(
"Length of sort_keys must be equal or greater than sort_dirs",
resp.body
resp.body.decode()
)
def test_get_all_pagination_unknown_direction(self):
@ -307,4 +307,4 @@ class TestExecutionsController(base.FunctionalTest):
self.assertEqual(400, resp.status_int)
self.assertIn("Unknown sort direction", resp.body)
self.assertIn("Unknown sort direction", resp.body.decode())

View File

@ -420,7 +420,7 @@ class TestWorkflowsController(base.FunctionalTest):
self.assertIn(
"Length of sort_keys must be equal or greater than sort_dirs",
resp.body
resp.body.decode()
)
def test_get_all_pagination_unknown_direction(self):
@ -431,7 +431,7 @@ class TestWorkflowsController(base.FunctionalTest):
self.assertEqual(400, resp.status_int)
self.assertIn("Unknown sort direction", resp.body)
self.assertIn("Unknown sort direction", resp.body.decode())
@mock.patch('mistral.db.v2.api.get_workflow_definitions')
def test_get_all_with_fields_filter(self, mock_get_db_wfs):
@ -461,7 +461,7 @@ class TestWorkflowsController(base.FunctionalTest):
self.assertIn(
"nonexist are invalid",
resp.body
resp.body.decode()
)
def test_validate(self):