Activity log for bug #1586268

Date Who What changed Old value New value Message
2016-05-27 07:05:53 Yafei Yu bug added bug
2016-05-27 07:06:19 Yafei Yu tags unittest
2016-05-27 07:12:47 Yafei Yu description Version: master(20160527) steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py line50--line62. def test_eq(self): # Two resources with same ID: never equal if their info is not equal r1 = base.Resource(None, {'id': 1, 'name': 'hi'}) r2 = base.Resource(None, {'id': 1, 'name': 'hello'}) self.assertNotEqual(r1, r2) # Two resources with same ID: equal if their info is equal r1 = base.Resource(None, {'id': 1, 'name': 'hello'}) r2 = base.Resource(None, {'id': 1, 'name': 'hello'}) # self.assertEqual(r1, r2) self.assertNotEqual(r1, r2) # Two resoruces of different types: never equal r1 = base.Resource(None, {'id': 1}) r2 = volumes.Volume(None, {'id': 1}) self.assertNotEqual(r1, r2) # Two resources with no ID: equal if their info is equal r1 = base.Resource(None, {'name': 'joe', 'age': 12}) r2 = base.Resource(None, {'name': 'joe', 'age': 12}) # self.assertEqual(r1, r2) self.assertNotEqual(r1, r2) Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. I think this test case doesn't work and need to fix. Version: master(20160527) steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2) Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. I think this test case doesn't work and need to fix.
2016-05-27 07:45:51 jingtao liang python-cinderclient: assignee jingtao liang (liang-jingtao)
2016-05-27 07:54:22 jingtao liang python-cinderclient: status New In Progress
2016-05-27 09:23:38 Yafei Yu description Version: master(20160527) steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2) Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. I think this test case doesn't work and need to fix. Version: master(20160527) unit.test_base.BaseTest.test_eq does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object): def __init__(self, person): self.person = person def __eq__(self, other): return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True So I think this test case doesn't work at all and need to fix it.
2016-05-27 09:24:15 Yafei Yu description Version: master(20160527) unit.test_base.BaseTest.test_eq does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object): def __init__(self, person): self.person = person def __eq__(self, other): return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True So I think this test case doesn't work at all and need to fix it. Version: master(20160527) cinderclient.tests.unit.test_base.BaseTest.test_eq does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True So I think this test case doesn't work at all and need to fix it.
2016-05-27 14:07:59 Eric Harney tags unittest tests
2016-05-28 05:02:59 Yafei Yu python-cinderclient: assignee jingtao liang (liang-jingtao) yuyafei (yu-yafei)
2016-05-30 06:16:33 Yafei Yu description Version: master(20160527) cinderclient.tests.unit.test_base.BaseTest.test_eq does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True So I think this test case doesn't work at all and need to fix it. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be deleted.
2016-05-30 06:16:58 Yafei Yu summary Unit test: unit.test_base.BaseTest.test_eq does not work Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does not work
2016-06-01 02:11:18 Yafei Yu description Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") print r1 != r2 print r1 == r2 The result is : True True If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be deleted. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r1 != r2 print r1 == r2 The result is : True True True False If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be instead.
2016-06-01 02:21:08 Yafei Yu description Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r1 != r2 print r1 == r2 The result is : True True True False If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be instead. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be instead.
2016-06-01 04:40:09 Yafei Yu description Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False If r1 is precisely the same to r2, both self.assertEqual(r1, r2) and self.assertNotEqual(r1, r2) return true and whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be instead. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be modified.
2016-06-15 07:01:40 Yafei Yu description Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be modified. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be modified.
2016-07-04 05:20:07 Yafei Yu description Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all and should be modified. Version: master(20160527) In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work. Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case. steps: 1 Clone code of python-cinderclient from master. 2 Modify the case of unit test: cinderclient/tests/unit/test_base.py   line50--line62.     def test_eq(self):         # Two resources with same ID: never equal if their info is not equal         r1 = base.Resource(None, {'id': 1, 'name': 'hi'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         self.assertNotEqual(r1, r2)         # Two resources with same ID: equal if their info is equal         r1 = base.Resource(None, {'id': 1, 'name': 'hello'})         r2 = base.Resource(None, {'id': 1, 'name': 'hello'})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)         # Two resoruces of different types: never equal         r1 = base.Resource(None, {'id': 1})         r2 = volumes.Volume(None, {'id': 1})         self.assertNotEqual(r1, r2)         # Two resources with no ID: equal if their info is equal         r1 = base.Resource(None, {'name': 'joe', 'age': 12})         r2 = base.Resource(None, {'name': 'joe', 'age': 12})         # self.assertEqual(r1, r2)         self.assertNotEqual(r1, r2)    Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2). 3 Run unit test, and return success. After that, I make a test: class Resource(object):     def __init__(self, person):         self.person = person     def __eq__(self, other):         return self.person == other.person r1 = Resource("test") r2 = Resource("test") r3 = Resource("test_r3") r4 = Resource("test_r4") print r1 != r2 print r1 == r2 print r3 != r4 print r3 == r4 The result is : True True True False Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all in python2 and should be modified.
2016-07-04 05:45:07 Yafei Yu bug task added python-novaclient
2016-07-04 05:45:13 Yafei Yu python-novaclient: assignee yuyafei (yu-yafei)
2016-07-04 05:45:52 Yafei Yu bug task added python-keystoneclient
2016-07-04 05:45:58 Yafei Yu python-keystoneclient: assignee yuyafei (yu-yafei)
2016-07-04 05:46:20 Yafei Yu bug task added python-heatclient
2016-07-04 05:46:26 Yafei Yu python-heatclient: assignee yuyafei (yu-yafei)
2016-07-04 05:46:51 Yafei Yu bug task added python-manilaclient
2016-07-04 05:46:58 Yafei Yu python-manilaclient: assignee yuyafei (yu-yafei)
2016-07-04 05:47:10 Yafei Yu summary Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does not work Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does not work in PY2
2016-07-04 06:04:10 OpenStack Infra python-novaclient: status New In Progress
2016-07-04 06:25:44 Yafei Yu bug task added python-glanceclient
2016-07-04 06:25:53 Yafei Yu python-glanceclient: assignee yuyafei (yu-yafei)
2016-07-04 06:26:21 Yafei Yu bug task added python-troveclient
2016-07-04 06:26:29 Yafei Yu python-troveclient: assignee yuyafei (yu-yafei)
2016-07-04 06:26:41 Yafei Yu bug task added python-muranoclient
2016-07-04 06:26:49 Yafei Yu python-muranoclient: assignee yuyafei (yu-yafei)
2016-07-04 06:26:53 Ji.Wei bug task added tempest
2016-07-04 06:27:04 Ji.Wei tempest: assignee Ji.Wei (jiwei)
2016-07-04 06:27:17 Ji.Wei bug task added nova
2016-07-04 06:27:29 Ji.Wei nova: assignee Ji.Wei (jiwei)
2016-07-04 06:28:11 Ji.Wei bug task added ceilometer
2016-07-04 06:28:24 Ji.Wei ceilometer: assignee Ji.Wei (jiwei)
2016-07-04 06:28:52 Ji.Wei bug task added neutron
2016-07-04 06:29:05 Ji.Wei neutron: assignee Ji.Wei (jiwei)
2016-07-04 06:29:41 Ji.Wei bug task added swift
2016-07-04 06:30:20 Ji.Wei swift: assignee Ji.Wei (jiwei)
2016-07-04 06:30:46 Ji.Wei bug task added rally
2016-07-04 06:30:50 Yafei Yu bug task added python-congressclient
2016-07-04 06:31:11 Ji.Wei rally: assignee Ji.Wei (jiwei)
2016-07-04 06:31:17 Yafei Yu python-congressclient: assignee yuyafei (yu-yafei)
2016-07-04 06:31:30 Ji.Wei python-congressclient: assignee yuyafei (yu-yafei) Ji.Wei (jiwei)
2016-07-04 06:31:34 Yafei Yu bug task added python-smaugclient
2016-07-04 06:31:47 Yafei Yu python-smaugclient: assignee yuyafei (yu-yafei)
2016-07-04 06:31:57 Ji.Wei python-congressclient: assignee Ji.Wei (jiwei)
2016-07-04 06:32:29 Yafei Yu bug task added cloudkitty
2016-07-04 06:32:38 Ji.Wei bug task added daisycloud-core
2016-07-04 06:32:45 Yafei Yu bug task deleted cloudkitty
2016-07-04 06:33:18 Ji.Wei daisycloud-core: assignee Ji.Wei (jiwei)
2016-07-04 06:33:46 Ji.Wei bug task added keystonemiddleware
2016-07-04 06:34:11 Ji.Wei keystonemiddleware: assignee Ji.Wei (jiwei)
2016-07-04 06:34:27 Ji.Wei bug task added keystone
2016-07-04 06:34:44 Ji.Wei keystone: assignee Ji.Wei (jiwei)
2016-07-04 06:35:37 Ji.Wei bug task added heat
2016-07-04 06:36:08 Ji.Wei heat: assignee Ji.Wei (jiwei)
2016-07-04 06:40:28 Ji.Wei bug task added glance
2016-07-04 06:40:49 Ji.Wei glance: assignee Ji.Wei (jiwei)
2016-07-04 06:41:01 Yafei Yu bug task added python-ceilometerclient
2016-07-04 06:41:13 Yafei Yu python-ceilometerclient: assignee yuyafei (yu-yafei)
2016-07-04 06:42:18 Yafei Yu python-congressclient: assignee yuyafei (yu-yafei)
2016-07-04 06:43:46 Yafei Yu bug task added python-cloudkittyclient (Ubuntu)
2016-07-04 06:44:14 Ji.Wei bug task added cinder
2016-07-04 06:44:57 Ji.Wei cinder: assignee Ji.Wei (jiwei)
2016-07-04 06:46:01 Ji.Wei bug task added python-swiftclient
2016-07-04 06:46:19 Ji.Wei python-swiftclient: assignee Ji.Wei (jiwei)
2016-07-04 06:50:32 OpenStack Infra python-heatclient: status New In Progress
2016-07-04 06:57:53 OpenStack Infra python-ceilometerclient: status New In Progress
2016-07-04 06:58:51 Yafei Yu bug task deleted python-cloudkittyclient (Ubuntu)
2016-07-04 07:03:58 zhanghaixia bug task added python-barbicanclient
2016-07-04 07:07:13 zhanghaixia bug task added horizon
2016-07-04 12:37:43 Markus Zoeller (markus_z) bug watch added http://bugs.python.org/issue21408
2016-07-04 12:40:53 Markus Zoeller (markus_z) nova: importance Undecided High
2016-07-04 12:40:53 Markus Zoeller (markus_z) nova: status New Confirmed
2016-07-05 00:59:18 Ji.Wei horizon: assignee Ji.Wei (jiwei)
2016-07-05 01:25:40 OpenStack Infra nova: status Confirmed In Progress
2016-07-05 01:25:40 OpenStack Infra nova: assignee Ji.Wei (jiwei) yuyafei (yu-yafei)
2016-07-05 04:29:07 OpenStack Infra python-heatclient: status In Progress Fix Released
2016-07-05 05:42:50 OpenStack Infra python-glanceclient: status New In Progress
2016-07-05 05:45:46 OpenStack Infra python-congressclient: status New In Progress
2016-07-05 05:53:46 OpenStack Infra python-keystoneclient: status New In Progress
2016-07-05 06:04:51 OpenStack Infra python-muranoclient: status New In Progress
2016-07-05 06:10:49 OpenStack Infra python-smaugclient: status New In Progress
2016-07-05 06:14:12 OpenStack Infra python-troveclient: status New In Progress
2016-07-05 10:38:42 OpenStack Infra glance: status New In Progress
2016-07-05 10:47:56 OpenStack Infra python-cinderclient: status In Progress Fix Released
2016-07-05 11:10:44 Ji.Wei bug task deleted cinder
2016-07-05 11:12:39 Ji.Wei bug task deleted keystone
2016-07-05 11:30:25 Ji.Wei bug task deleted rally
2016-07-06 00:37:13 Yafei Yu nova: assignee yuyafei (yu-yafei) Ji.Wei (jiwei)
2016-07-06 14:49:25 OpenStack Infra python-muranoclient: status In Progress Fix Released
2016-07-09 10:02:13 OpenStack Infra python-novaclient: assignee yuyafei (yu-yafei) Andrey Kurilin (andreykurilin)
2016-07-09 12:18:13 OpenStack Infra python-novaclient: status In Progress Fix Released
2016-07-11 08:39:16 Ji.Wei bug task deleted glance
2016-07-12 02:54:42 OpenStack Infra python-ceilometerclient: status In Progress Fix Released
2016-07-14 07:33:16 OpenStack Infra tempest: status New In Progress
2016-07-14 08:19:15 OpenStack Infra ceilometer: status New In Progress
2016-07-14 08:40:47 Ji.Wei bug task deleted swift
2016-07-14 08:42:36 Ji.Wei bug task deleted python-swiftclient
2016-07-15 02:16:32 OpenStack Infra ceilometer: status In Progress Fix Released
2016-07-16 03:30:46 OpenStack Infra neutron: status New In Progress
2016-07-21 09:08:49 OpenStack Infra python-smaugclient: status In Progress Fix Released
2016-07-22 18:56:26 OpenStack Infra python-congressclient: status In Progress Fix Released
2016-07-27 11:21:40 NidhiMittalHada python-manilaclient: assignee yuyafei (yu-yafei) NidhiMittalHada (nidhimittal19)
2016-08-02 01:51:11 Steve Martinelli bug task deleted keystonemiddleware
2016-08-02 01:59:17 Steve Martinelli bug task deleted python-keystoneclient
2016-08-09 00:42:50 Yafei Yu bug task added python-keystoneclient
2016-08-09 00:43:05 Yafei Yu python-keystoneclient: assignee yuyafei (yu-yafei)
2016-08-09 00:43:24 Yafei Yu python-keystoneclient: status New In Progress
2016-08-09 01:13:59 Yafei Yu bug task deleted python-troveclient
2016-08-11 03:55:41 OpenStack Infra python-keystoneclient: status In Progress Fix Released
2016-08-13 06:10:01 OpenStack Infra python-manilaclient: status New In Progress
2016-08-13 06:10:01 OpenStack Infra python-manilaclient: assignee NidhiMittalHada (nidhimittal19) yuyafei (yu-yafei)
2016-08-23 09:24:43 Hanxi Liu bug task added panko
2016-08-23 09:25:00 Hanxi Liu panko: assignee Hanxi Liu (hanxi-liu)
2016-08-23 09:29:13 Hanxi Liu bug task added gnocchi
2016-08-23 09:29:32 Hanxi Liu gnocchi: assignee Hanxi Liu (hanxi-liu)
2016-08-23 15:29:22 OpenStack Infra panko: status New In Progress
2016-08-23 16:14:20 OpenStack Infra gnocchi: status New In Progress
2016-08-31 07:22:08 Ji.Wei bug task added octavia
2016-08-31 07:22:27 Ji.Wei octavia: assignee Ji.Wei (jiwei)
2016-08-31 07:23:35 Ji.Wei bug task added kosmos
2016-08-31 07:23:52 Ji.Wei kosmos: assignee Ji.Wei (jiwei)
2016-08-31 08:28:05 Ji.Wei bug task added taskflow
2016-08-31 08:28:57 Ji.Wei taskflow: assignee Ji.Wei (jiwei)
2016-08-31 08:47:34 OpenStack Infra taskflow: status New In Progress
2016-09-01 12:28:04 OpenStack Infra taskflow: status In Progress Fix Released
2016-09-02 14:05:38 OpenStack Infra tempest: status In Progress Fix Released
2016-09-06 05:15:15 jayaprakash bug added subscriber jayaprakash
2016-09-14 15:25:21 Julien Danjou bug task deleted gnocchi
2016-09-14 17:08:58 OpenStack Infra panko: status In Progress Fix Released
2016-09-22 01:46:48 OpenStack Infra python-manilaclient: status In Progress Fix Released
2016-09-26 17:36:03 Ihar Hrachyshka bug task deleted neutron
2016-10-18 21:28:56 Michael Johnson octavia: importance Undecided Low
2016-10-18 21:28:56 Michael Johnson octavia: status New Fix Released
2016-12-09 16:47:29 Sean Dague bug task deleted nova
2016-12-09 16:48:05 Sean Dague bug task deleted ceilometer
2016-12-09 16:48:18 Sean Dague bug task deleted heat
2016-12-09 16:48:29 Sean Dague bug task deleted python-novaclient
2016-12-09 16:48:37 Sean Dague bug task deleted tempest
2016-12-09 16:48:43 Sean Dague bug task deleted python-manilaclient
2016-12-09 16:48:51 Sean Dague bug task deleted python-keystoneclient
2016-12-09 16:48:58 Sean Dague bug task deleted python-heatclient
2016-12-09 16:49:06 Sean Dague bug task deleted python-cinderclient
2016-12-09 16:49:13 Sean Dague bug task deleted python-ceilometerclient
2016-12-09 16:49:20 Sean Dague bug task deleted python-barbicanclient
2016-12-09 16:49:27 Sean Dague bug task deleted horizon
2016-12-09 16:49:38 Sean Dague bug task deleted python-glanceclient
2018-08-01 06:59:20 Ji.Wei kosmos: assignee Ji.Wei (jiwei)
2018-08-01 06:59:30 Ji.Wei daisycloud-core: assignee Ji.Wei (jiwei)