Useless return statement in validate_sort_dir
In watcher/api/controllers/v1/utils.py, in the validate_sort_dir method has a return statement, however the return value is exactly the parameter's value. This is misleading, so I removed it. Change-Id: I18c5c7853a5afedac88431347712a4348c9fd5dd Closes-Bug: #1546917
This commit is contained in:
@@ -40,8 +40,11 @@ class TestApiUtils(base.TestCase):
|
||||
self.assertRaises(wsme.exc.ClientSideError, utils.validate_limit, 0)
|
||||
|
||||
def test_validate_sort_dir(self):
|
||||
sort_dir = utils.validate_sort_dir('asc')
|
||||
self.assertEqual('asc', sort_dir)
|
||||
# if sort_dir is valid, nothing should happen
|
||||
try:
|
||||
utils.validate_sort_dir('asc')
|
||||
except Exception as exc:
|
||||
self.fail(exc)
|
||||
|
||||
# invalid sort_dir parameter
|
||||
self.assertRaises(wsme.exc.ClientSideError,
|
||||
|
||||
Reference in New Issue
Block a user