Merge "Refactored filter implementation."
This commit is contained in:
commit
34b1fa48e3
@ -35,8 +35,8 @@ class ListType(wtypes.UserType):
|
|||||||
"""
|
"""
|
||||||
items = [v.strip().lower() for v in six.text_type(value).split(',')]
|
items = [v.strip().lower() for v in six.text_type(value).split(',')]
|
||||||
|
|
||||||
# filter() to remove empty items.
|
# remove empty items.
|
||||||
return filter(None, items)
|
return [x for x in items if x]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def frombasetype(value):
|
def frombasetype(value):
|
||||||
|
@ -325,7 +325,7 @@ class TestActionsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"Length of sort_keys must be equal or greater than sort_dirs",
|
"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):
|
def test_get_all_pagination_unknown_direction(self):
|
||||||
@ -336,4 +336,4 @@ class TestActionsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertEqual(400, resp.status_int)
|
self.assertEqual(400, resp.status_int)
|
||||||
|
|
||||||
self.assertIn("Unknown sort direction", resp.body)
|
self.assertIn("Unknown sort direction", resp.body.decode())
|
||||||
|
@ -296,7 +296,7 @@ class TestExecutionsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"Length of sort_keys must be equal or greater than sort_dirs",
|
"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):
|
def test_get_all_pagination_unknown_direction(self):
|
||||||
@ -307,4 +307,4 @@ class TestExecutionsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertEqual(400, resp.status_int)
|
self.assertEqual(400, resp.status_int)
|
||||||
|
|
||||||
self.assertIn("Unknown sort direction", resp.body)
|
self.assertIn("Unknown sort direction", resp.body.decode())
|
||||||
|
@ -420,7 +420,7 @@ class TestWorkflowsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"Length of sort_keys must be equal or greater than sort_dirs",
|
"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):
|
def test_get_all_pagination_unknown_direction(self):
|
||||||
@ -431,7 +431,7 @@ class TestWorkflowsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertEqual(400, resp.status_int)
|
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')
|
@mock.patch('mistral.db.v2.api.get_workflow_definitions')
|
||||||
def test_get_all_with_fields_filter(self, mock_get_db_wfs):
|
def test_get_all_with_fields_filter(self, mock_get_db_wfs):
|
||||||
@ -461,7 +461,7 @@ class TestWorkflowsController(base.FunctionalTest):
|
|||||||
|
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"nonexist are invalid",
|
"nonexist are invalid",
|
||||||
resp.body
|
resp.body.decode()
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_validate(self):
|
def test_validate(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user