Comment 51 for bug 1586268

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (master)

Submitter: Jenkins
Branch: master

commit ee60b3aabe1fe7de3527c2a8a18f1769d2338b7e
Author: yuyafei <email address hidden>
Date: Sat Aug 13 15:42:08 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.

    Without the change in, if r1==r2, the follow code should all
        self.assertEqual(r1, r2)
        self.assertNotEqual(r1, r2)
    The change here is for a way to self.assertNotEqual(r1, r2) as

    Change-Id: I72485d38eab8b5a2034a621e1eebf33b86832f35
    Closes-Bug: #1586268