Comment 51 for bug 1586268

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

Reviewed: https://review.openstack.org/355157
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=ee60b3aabe1fe7de3527c2a8a18f1769d2338b7e
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.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

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

    Change-Id: I72485d38eab8b5a2034a621e1eebf33b86832f35
    Closes-Bug: #1586268