TestController.test_update patch_kwargs dicts don't appear to be guaranteed to be in the order the test expects. If the dicts aren't in the expected order, the test will fail:
======================================================================
FAIL: glareclient.tests.unit.v1.test_artifacts.TestController.test_update
glareclient.tests.unit.v1.test_artifacts.TestController.test_update
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/glareclient/tests/unit/v1/test_artifacts.py", line 59, in test_update
'/artifacts/checked_name/test-id', **patch_kwargs)
File "/usr/lib/python3/dist-packages/mock/mock.py", line 948, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/usr/lib/python3/dist-packages/mock/mock.py", line 937, in assert_called_with
six.raise_from(AssertionError(_error_message(cause)), cause)
File "<string>", line 2, in raise_from
AssertionError: Expected call: patch('/artifacts/checked_name/test-id', headers={'Content-Type': 'application/json-patch+json'}, json=[{'path': '/remove1', 'value': None, 'op': 'replace'}, {'path': '/remove2', 'value': None, 'op': 'replace'}, {'path': '/update2', 'value': 2, 'op': 'add'}, {'path': '/update1', 'value': 1, 'op': 'add'}])
Actual call: patch('/artifacts/checked_name/test-id', headers={'Content-Type': 'application/json-patch+json'}, json=[{'op': 'replace', 'path': '/remove1', 'value': None}, {'op': 'replace', 'path': '/remove2', 'value': None}, {'op': 'add', 'path': '/update1', 'value': 1}, {'op': 'add', 'path': '/update2', 'value': 2}])
This test also fails if the list order is different than expected:
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= tests.unit. v1.test_ artifacts. TestController. test_get_ type_list tests.unit. v1.test_ artifacts. TestController. test_get_ type_list ------- ------- ------- ------- ------- ------- ------- ------- ------- >>/glareclient/ tests/unit/ v1/test_ artifacts. py", line 126, in test_get_type_list assertEqual( expected_ types, self.c. get_type_ list()) python3/ dist-packages/ testtools/ testcase. py", line 350, in assertEqual assertThat( observed, matcher, message) python3/ dist-packages/ testtools/ testcase. py", line 435, in assertThat matchers. _impl.MismatchE rror: [('a', 1), ('b', 2)] != [('b', 2), ('a', 1)]
FAIL: glareclient.
glareclient.
-------
_StringException: Traceback (most recent call last):
File "/<<PKGBUILDDIR
self.
File "/usr/lib/
self.
File "/usr/lib/
raise mismatch_error
testtools.