mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-25 02:40:03 +00:00
MBAPIHelper: introduce _make_inc_arg() to build inc parameter value
- it produces a more stable output (elements are sorted) - it gets rid of empty elements (preventing a++b case) - it accepts any iterable - add a test for it I also removed 2 useless conversion to tuple() (it can use a set() anyway)
This commit is contained in:
@@ -98,7 +98,7 @@ class MBAPITest(PicardTestCase):
|
||||
self.assertEqual(value, unencoded_query_args[argname])
|
||||
|
||||
def _test_inc_args(self, ws_function, arg_list):
|
||||
self.assertInQuery(self.ws.get_url, 'inc', "+".join(arg_list))
|
||||
self.assertInQuery(self.ws.get_url, 'inc', self.api._make_inc_arg(arg_list))
|
||||
|
||||
def test_get_release(self):
|
||||
inc_args_list = ['test']
|
||||
@@ -212,6 +212,11 @@ class MBAPITest(PicardTestCase):
|
||||
with self.assertRaises(StopIteration):
|
||||
next(generator)
|
||||
|
||||
def test_make_inc_arg(self):
|
||||
result = self.api._make_inc_arg(['b', 'a', '', 1, (), 0])
|
||||
expected = '1+a+b'
|
||||
self.assertEqual(result, expected)
|
||||
|
||||
|
||||
class AcoustdIdAPITest(PicardTestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user