Comment 8 for bug 1277104

Revision history for this message
Ken'ichi Ohmichi (oomichi) wrote :

@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.