@Dolph,
The reason why we should fix the order is assertEqual() outputs "reference" and "actual" if the length of "actual" is over 70 chars.
Traceback (most recent call last): File "/opt/stack/cinder/cinder/tests/test_zadara.py", line 553, in test_volume_attach_detach self.assertEqual(props['driver_volume_type'], 'iscsi000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 321, in assertEqual self.assertThat(observed, matcher, message) File "/opt/stack/cinder/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat raise mismatch_error MismatchError: !=: reference = 'iscsi' actual = 'iscsi000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
The code is https://github.com/testing-cabal/testtools/blob/master/testtools/matchers/_basic.py#L77
When I faced some problems with assertEqual(), I was confused due to invalid order. This fixing would make debugging more easy.
@Dolph,
The reason why we should fix the order is assertEqual() outputs "reference" and "actual" if the length of "actual" is over 70 chars.
Traceback (most recent call last): cinder/ cinder/ tests/test_ zadara. py", line 553, in test_volume_ attach_ detach assertEqual( props[' driver_ volume_ type'], 'iscsi000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000' ) cinder/ .venv/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 321, in assertEqual assertThat( observed, matcher, message) cinder/ .venv/local/ lib/python2. 7/site- packages/ testtools/ testcase. py", line 406, in assertThat 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000'
File "/opt/stack/
self.
File "/opt/stack/
self.
File "/opt/stack/
raise mismatch_error
MismatchError: !=:
reference = 'iscsi'
actual = 'iscsi000000000
The code is https:/ /github. com/testing- cabal/testtools /blob/master/ testtools/ matchers/ _basic. py#L77
When I faced some problems with assertEqual(), I was confused due to invalid order.
This fixing would make debugging more easy.