Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
python-etcd
remove_nose.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File remove_nose.patch of Package python-etcd
--- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ install_requires = [ test_requires = [ 'mock', - 'nose', 'pyOpenSSL>=0.14' ] @@ -42,6 +41,5 @@ setup( include_package_data=True, zip_safe=False, install_requires=install_requires, - tests_require=test_requires, - test_suite='nose.collector', + tests_require=test_requires ) --- a/src/etcd/tests/integration/test_ssl.py +++ b/src/etcd/tests/integration/test_ssl.py @@ -11,7 +11,6 @@ import urllib3 import etcd from . import helpers from . import test_simple -from nose.tools import nottest log = logging.getLogger() @@ -67,7 +66,7 @@ class TestEncryptedAccess(test_simple.Et self.assertRaises(etcd.EtcdException, client.get, '/test_set') - @nottest + @unittest.skip("This doesn't work for now and will need further inspection") def test_get_set_unauthenticated_missing_ca(self): """ INTEGRATION: try unauthenticated w/out validation (https->https)""" # This doesn't work for now and will need further inspection @@ -156,7 +155,7 @@ class TestClientAuthenticatedAccess(test etcd.EtcdException, client.set, '/test_set', 'test-key') self.assertRaises(etcd.EtcdException, client.get, '/test_set') - @nottest + @unittest.skip("This doesn't work for now and will need further inspection") def test_get_set_authenticated(self): """ INTEGRATION: connecting to server with mutual auth """ # This gives an unexplicable ssl error, as connecting to the same @@ -171,10 +170,10 @@ class TestClientAuthenticatedAccess(test ) set_result = client.set('/test_set', 'test-key') - self.assertEquals(u'set', set_result.action.lower()) - self.assertEquals(u'/test_set', set_result.key) - self.assertEquals(u'test-key', set_result.value) + self.assertEqual(u'set', set_result.action.lower()) + self.assertEqual(u'/test_set', set_result.key) + self.assertEqual(u'test-key', set_result.value) get_result = client.get('/test_set') - self.assertEquals('get', get_result.action.lower()) - self.assertEquals('/test_set', get_result.key) - self.assertEquals('test-key', get_result.value) + self.assertEqual('get', get_result.action.lower()) + self.assertEqual('/test_set', get_result.key) + self.assertEqual('test-key', get_result.value) --- a/src/etcd/tests/integration/test_simple.py +++ b/src/etcd/tests/integration/test_simple.py @@ -11,9 +11,6 @@ import urllib3 import etcd from . import helpers -from nose.tools import nottest - - log = logging.getLogger() @@ -64,7 +61,7 @@ class TestSimple(EtcdIntegrationTest): def test_machines(self): """ INTEGRATION: retrieve machines """ - self.assertEquals(self.client.machines[0], 'http://127.0.0.1:6001') + self.assertEqual(self.client.machines[0], 'http://127.0.0.1:6001') def test_leader(self): """ INTEGRATION: retrieve leader """ @@ -82,20 +79,20 @@ class TestSimple(EtcdIntegrationTest): self.assertFalse('/test_set' in self.client) set_result = self.client.set('/test_set', 'test-key') - self.assertEquals('set', set_result.action.lower()) - self.assertEquals('/test_set', set_result.key) - self.assertEquals('test-key', set_result.value) + self.assertEqual('set', set_result.action.lower()) + self.assertEqual('/test_set', set_result.key) + self.assertEqual('test-key', set_result.value) self.assertTrue('/test_set' in self.client) get_result = self.client.get('/test_set') - self.assertEquals('get', get_result.action.lower()) - self.assertEquals('/test_set', get_result.key) - self.assertEquals('test-key', get_result.value) + self.assertEqual('get', get_result.action.lower()) + self.assertEqual('/test_set', get_result.key) + self.assertEqual('test-key', get_result.value) delete_result = self.client.delete('/test_set') - self.assertEquals('delete', delete_result.action.lower()) - self.assertEquals('/test_set', delete_result.key) + self.assertEqual('delete', delete_result.action.lower()) + self.assertEqual('/test_set', delete_result.key) self.assertFalse('/test_set' in self.client) @@ -112,7 +109,7 @@ class TestSimple(EtcdIntegrationTest): c.value = int(c.value) + 3 self.client.update(c) newres = self.client.get('/foo') - self.assertEquals(newres.value, u'6') + self.assertEqual(newres.value, u'6') self.assertRaises(ValueError, self.client.update, c) def test_retrieve_subkeys(self): @@ -122,17 +119,17 @@ class TestSimple(EtcdIntegrationTest): set_result = self.client.write('/subtree/test_set2', 'test-key3') get_result = self.client.read('/subtree', recursive=True) result = [subkey.value for subkey in get_result.leaves] - self.assertEquals(['test-key1', 'test-key2', 'test-key3'].sort(), result.sort()) + self.assertEqual(['test-key1', 'test-key2', 'test-key3'].sort(), result.sort()) def test_directory_ttl_update(self): """ INTEGRATION: should be able to update a dir TTL """ self.client.write('/dir', None, dir=True, ttl=30) res = self.client.write('/dir', None, dir=True, ttl=31, prevExist=True) - self.assertEquals(res.ttl, 31) + self.assertEqual(res.ttl, 31) res = self.client.get('/dir') res.ttl = 120 new_res = self.client.update(res) - self.assertEquals(new_res.ttl, 120) + self.assertEqual(new_res.ttl, 120) @@ -187,12 +184,12 @@ class TestClusterFunctions(EtcdIntegrati set_result = self.client.set('/test_set', 'test-key1') get_result = self.client.get('/test_set') - self.assertEquals('test-key1', get_result.value) + self.assertEqual('test-key1', get_result.value) self.processHelper.kill_one(0) get_result = self.client.get('/test_set') - self.assertEquals('test-key1', get_result.value) + self.assertEqual('test-key1', get_result.value) def test_reconnect_with_several_hosts_passed(self): """ INTEGRATION: receive several hosts at connection setup. """ @@ -206,12 +203,12 @@ class TestClusterFunctions(EtcdIntegrati set_result = self.client.set('/test_set', 'test-key1') get_result = self.client.get('/test_set') - self.assertEquals('test-key1', get_result.value) + self.assertEqual('test-key1', get_result.value) self.processHelper.kill_one(0) get_result = self.client.get('/test_set') - self.assertEquals('test-key1', get_result.value) + self.assertEqual('test-key1', get_result.value) def test_reconnect_not_allowed(self): """ INTEGRATION: fail on server kill if not allow_reconnect """ @@ -232,7 +229,7 @@ class TestClusterFunctions(EtcdIntegrati set_result = self.client.set('/test_set', 'test-key1') get_result = self.client.get('/test_set') - self.assertEquals('test-key1', get_result.value) + self.assertEqual('test-key1', get_result.value) self.processHelper.kill_one(2) self.processHelper.kill_one(1) self.processHelper.kill_one(0) @@ -308,7 +305,7 @@ class TestWatch(EtcdIntegrationTest): for i in range(0, 3): value = queue.get() log.debug("index: %d: %s" % (i, value)) - self.assertEquals('test-value%d' % i, value) + self.assertEqual('test-value%d' % i, value) watcher.join(timeout=5) proc.join(timeout=5) @@ -385,7 +382,7 @@ class TestWatch(EtcdIntegrationTest): for i in range(0, 3): value = queue.get() log.debug("index: %d: %s" % (i, value)) - self.assertEquals('test-value%d' % i, value) + self.assertEqual('test-value%d' % i, value) watcher.join(timeout=5) proc.join(timeout=5) --- a/src/etcd/tests/test_auth.py +++ b/src/etcd/tests/test_auth.py @@ -35,7 +35,7 @@ class TestEtcdAuthBase(EtcdIntegrationTe class EtcdUserTest(TestEtcdAuthBase): def test_names(self): u = auth.EtcdUser(self.client, 'test_user') - self.assertEquals(u.names, ['root']) + self.assertEqual(u.names, ['root']) def test_read(self): u = auth.EtcdUser(self.client, 'root') @@ -46,10 +46,10 @@ class EtcdUserTest(TestEtcdAuthBase): self.fail("reading the root user raised an exception") # roles for said user are fetched - self.assertEquals(u.roles, set(['root'])) + self.assertEqual(u.roles, set(['root'])) # The user is correctly rendered out - self.assertEquals(u._to_net(), [{'user': 'root', 'password': None, + self.assertEqual(u._to_net(), [{'user': 'root', 'password': None, 'roles': ['root']}]) # An inexistent user raises the appropriate exception @@ -77,7 +77,7 @@ class EtcdUserTest(TestEtcdAuthBase): except: self.fail("creating a user doesn't work") # Password gets wiped - self.assertEquals(u.password, None) + self.assertEqual(u.password, None) u.read() # Verify we can log in as this user and access the auth (it has the # root role) @@ -89,8 +89,8 @@ class EtcdUserTest(TestEtcdAuthBase): except etcd.EtcdInsufficientPermissions: self.fail("Reading auth with the new user is not possible") - self.assertEquals(u.name, "test_user") - self.assertEquals(u.roles, set(['guest', 'root'])) + self.assertEqual(u.name, "test_user") + self.assertEqual(u.roles, set(['guest', 'root'])) # set roles as a list, it works! u.roles = ['guest', 'test_group'] try: @@ -131,9 +131,9 @@ class EtcdRoleTest(TestEtcdAuthBase): # between etcd-2.2.2 and 2.2.5. They're equivalent so allow # for both. if '/*' in r.acls: - self.assertEquals(r.acls, {'/*': 'RW'}) + self.assertEqual(r.acls, {'/*': 'RW'}) else: - self.assertEquals(r.acls, {'*': 'RW'}) + self.assertEqual(r.acls, {'*': 'RW'}) # We can actually skip most other read tests as they are common # with EtcdUser @@ -147,15 +147,15 @@ class EtcdRoleTest(TestEtcdAuthBase): r1 = auth.EtcdRole(self.client, 'test_role') r1.read() - self.assertEquals(r1.acls, r.acls) + self.assertEqual(r1.acls, r.acls) r.revoke('/test/*', 'W') r.write() r1.read() - self.assertEquals(r1.acls, {'*': 'R', '/test/*': 'R'}) + self.assertEqual(r1.acls, {'*': 'R', '/test/*': 'R'}) r.grant('/pub/*', 'RW') r.write() r1.read() - self.assertEquals(r1.acls['/pub/*'], 'RW') + self.assertEqual(r1.acls['/pub/*'], 'RW') # All other exceptions are tested by the user tests r1.name = None self.assertRaises(etcd.EtcdException, r1.write) --- a/src/etcd/tests/unit/test_client.py +++ b/src/etcd/tests/unit/test_client.py @@ -142,8 +142,8 @@ class TestClient(unittest.TestCase): timeout=mock.ANY) # Verify the properties while we are here - self.assertEquals('2.2.3', client.version) - self.assertEquals('2.3.0', client.cluster_version) + self.assertEqual('2.2.3', client.version) + self.assertEqual('2.3.0', client.cluster_version) def test_version_property(self): """Ensure the version property is set on first access.""" @@ -157,7 +157,7 @@ class TestClient(unittest.TestCase): client = etcd.Client() # Verify the version property is set - self.assertEquals('2.2.3', client.version) + self.assertEqual('2.2.3', client.version) def test_cluster_version_property(self): """Ensure the cluster version property is set on first access.""" @@ -171,7 +171,7 @@ class TestClient(unittest.TestCase): client = etcd.Client() # Verify the cluster_version property is set - self.assertEquals('2.3.0', client.cluster_version) + self.assertEqual('2.3.0', client.cluster_version) def test_get_headers_without_auth(self): client = etcd.Client() @@ -207,7 +207,7 @@ class TestClient(unittest.TestCase): etcd.Client.machines = mock.create_autospec(etcd.Client.machines, return_value=[u'https://etcd2.example.com:2379']) c = etcd.Client(srv_domain="example.com", allow_reconnect=True, protocol="https") etcd.Client.machines = self.machines - self.assertEquals(c.host, u'etcd1.example.com') - self.assertEquals(c.port, 2379) - self.assertEquals(c._machines_cache, + self.assertEqual(c.host, u'etcd1.example.com') + self.assertEqual(c.port, 2379) + self.assertEqual(c._machines_cache, [u'https://etcd2.example.com:2379']) --- a/src/etcd/tests/unit/test_lock.py +++ b/src/etcd/tests/unit/test_lock.py @@ -31,9 +31,9 @@ class TestClientLock(TestClientApiBase): """ Verify the lock gets initialized correctly """ - self.assertEquals(self.locker.name, u'test_lock') - self.assertEquals(self.locker.path, u'/_locks/test_lock') - self.assertEquals(self.locker.is_taken, False) + self.assertEqual(self.locker.name, u'test_lock') + self.assertEqual(self.locker.path, u'/_locks/test_lock') + self.assertEqual(self.locker.is_taken, False) def test_acquire(self): """ @@ -52,8 +52,8 @@ class TestClientLock(TestClientApiBase): } } self._mock_api(200, d) - self.assertEquals(l.acquire(), True) - self.assertEquals(l._sequence, '1') + self.assertEqual(l.acquire(), True) + self.assertEqual(l._sequence, '1') def test_is_acquired(self): """ @@ -70,7 +70,7 @@ class TestClientLock(TestClientApiBase): } self._mock_api(200, d) self.locker.is_taken = True - self.assertEquals(self.locker.is_acquired, True) + self.assertEqual(self.locker.is_acquired, True) def test_is_not_acquired(self): """ @@ -78,11 +78,11 @@ class TestClientLock(TestClientApiBase): """ self.locker._sequence = '2' self.locker.is_taken = False - self.assertEquals(self.locker.is_acquired, False) + self.assertEqual(self.locker.is_acquired, False) self.locker.is_taken = True self._mock_exception(etcd.EtcdKeyNotFound, self.locker.lock_key) - self.assertEquals(self.locker.is_acquired, False) - self.assertEquals(self.locker.is_taken, False) + self.assertEqual(self.locker.is_acquired, False) + self.assertEqual(self.locker.is_taken, False) def test_acquired(self): """ @@ -147,11 +147,11 @@ class TestClientLock(TestClientApiBase): with self.assertRaises(ValueError): self.locker.lock_key self.locker._sequence = '5' - self.assertEquals(u'/_locks/test_lock/5',self.locker.lock_key) + self.assertEqual(u'/_locks/test_lock/5',self.locker.lock_key) def test_set_sequence(self): self.locker._set_sequence('/_locks/test_lock/10') - self.assertEquals('10', self.locker._sequence) + self.assertEqual('10', self.locker._sequence) def test_find_lock(self): d = { @@ -171,11 +171,11 @@ class TestClientLock(TestClientApiBase): self.locker._sequence = None self.recursive_read() self.assertTrue(self.locker._find_lock()) - self.assertEquals(self.locker._sequence, '34') + self.assertEqual(self.locker._sequence, '34') def test_get_locker(self): self.recursive_read() - self.assertEquals((u'/_locks/test_lock/1', etcd.EtcdResult(node={'newKey': False, '_children': [], 'createdIndex': 33, 'modifiedIndex': 33, 'value': u'2qwwwq', 'expiration': None, 'key': u'/_locks/test_lock/1', 'ttl': None, 'action': None, 'dir': False})), + self.assertEqual((u'/_locks/test_lock/1', etcd.EtcdResult(node={'newKey': False, '_children': [], 'createdIndex': 33, 'modifiedIndex': 33, 'value': u'2qwwwq', 'expiration': None, 'key': u'/_locks/test_lock/1', 'ttl': None, 'action': None, 'dir': False})), self.locker._get_locker()) with self.assertRaises(etcd.EtcdLockExpired): self.locker._sequence = '35' --- a/src/etcd/tests/unit/test_old_request.py +++ b/src/etcd/tests/unit/test_old_request.py @@ -42,7 +42,7 @@ class TestClientRequest(unittest.TestCas result = client.set('/testkey', 'test', ttl=19) - self.assertEquals( + self.assertEqual( etcd.EtcdResult( **{u'action': u'SET', 'node': { @@ -67,7 +67,7 @@ class TestClientRequest(unittest.TestCas '"ttl":49,"modifiedIndex":203}}') ) result = client.test_and_set('/testkey', 'newvalue', 'test', ttl=19) - self.assertEquals( + self.assertEqual( etcd.EtcdResult( **{u'action': u'SET', u'node': { @@ -94,7 +94,7 @@ class TestClientRequest(unittest.TestCas 'test', ttl=19) except ValueError as e: #from ipdb import set_trace; set_trace() - self.assertEquals( + self.assertEqual( 'The given PrevValue is not equal' ' to the value of the key : TestAndSet: 1!=3', str(e)) @@ -111,7 +111,7 @@ class TestClientRequest(unittest.TestCas '"modifiedIndex":189}}') ) result = client.delete('/testkey') - self.assertEquals(etcd.EtcdResult( + self.assertEqual(etcd.EtcdResult( **{u'action': u'DELETE', u'node': { u'expiration': u'2013-09-14T01:06:35.5242587+02:00', @@ -133,7 +133,7 @@ class TestClientRequest(unittest.TestCas ) result = client.get('/testkey') - self.assertEquals(etcd.EtcdResult( + self.assertEqual(etcd.EtcdResult( **{u'action': u'GET', u'node': { u'modifiedIndex': 190, @@ -154,7 +154,7 @@ class TestClientRequest(unittest.TestCas client = etcd.Client() client.get = mock.Mock(side_effect=etcd.EtcdKeyNotFound()) result = '/testkey' not in client - self.assertEquals(True, result) + self.assertEqual(True, result) def test_in(self): """ Can check if key is in client """ @@ -169,7 +169,7 @@ class TestClientRequest(unittest.TestCas ) result = '/testkey' in client - self.assertEquals(True, result) + self.assertEqual(True, result) def test_simple_watch(self): """ Can watch values """ @@ -186,7 +186,7 @@ class TestClientRequest(unittest.TestCas '"modifiedIndex":192}}') ) result = client.watch('/testkey') - self.assertEquals( + self.assertEqual( etcd.EtcdResult( **{u'action': u'SET', u'node': { @@ -213,7 +213,7 @@ class TestClientRequest(unittest.TestCas '"modifiedIndex":180}}') ) result = client.watch('/testkey', index=180) - self.assertEquals( + self.assertEqual( etcd.EtcdResult( **{u'action': u'SET', u'node': { @@ -267,7 +267,7 @@ class TestClientApiExecutor(unittest.Tes response = FakeHTTPResponse(status=200, data='arbitrary json data') client.http.request = mock.Mock(return_value=response) result = client.api_execute('/v1/keys/testkey', client._MGET) - self.assertEquals('arbitrary json data'.encode('utf-8'), result.data) + self.assertEqual('arbitrary json data'.encode('utf-8'), result.data) def test_delete(self): """ http delete request """ @@ -275,7 +275,7 @@ class TestClientApiExecutor(unittest.Tes response = FakeHTTPResponse(status=200, data='arbitrary json data') client.http.request = mock.Mock(return_value=response) result = client.api_execute('/v1/keys/testkey', client._MDELETE) - self.assertEquals('arbitrary json data'.encode('utf-8'), result.data) + self.assertEqual('arbitrary json data'.encode('utf-8'), result.data) def test_get_error(self): """ http get error request 101""" @@ -289,7 +289,7 @@ class TestClientApiExecutor(unittest.Tes client.api_execute('/v2/keys/testkey', client._MGET) assert False except etcd.EtcdKeyNotFound as e: - self.assertEquals(str(e), 'message : cause') + self.assertEqual(str(e), 'message : cause') def test_put(self): """ http put request """ @@ -297,7 +297,7 @@ class TestClientApiExecutor(unittest.Tes response = FakeHTTPResponse(status=200, data='arbitrary json data') client.http.request_encode_body = mock.Mock(return_value=response) result = client.api_execute('/v2/keys/testkey', client._MPUT) - self.assertEquals('arbitrary json data'.encode('utf-8'), result.data) + self.assertEqual('arbitrary json data'.encode('utf-8'), result.data) def test_test_and_set_error(self): """ http post error request 101 """ @@ -311,7 +311,7 @@ class TestClientApiExecutor(unittest.Tes client.api_execute('/v2/keys/testkey', client._MPUT, payload) self.fail() except ValueError as e: - self.assertEquals('message : cause', str(e)) + self.assertEqual('message : cause', str(e)) def test_set_not_file_error(self): """ http post error request 102 """ @@ -325,7 +325,7 @@ class TestClientApiExecutor(unittest.Tes client.api_execute('/v2/keys/testkey', client._MPUT, payload) self.fail() except etcd.EtcdNotFile as e: - self.assertEquals('message : cause', str(e)) + self.assertEqual('message : cause', str(e)) def test_get_error_unknown(self): """ http get error request unknown """ --- a/src/etcd/tests/unit/test_request.py +++ b/src/etcd/tests/unit/test_request.py @@ -68,7 +68,7 @@ class TestClientApiInternals(TestClientA } self._mock_api(200, d) self.client.write('/newdir', None, dir=True) - self.assertEquals(self.client.api_execute.call_args, + self.assertEqual(self.client.api_execute.call_args, (('/v2/keys/newdir', 'PUT'), dict(params={'dir': 'true'}))) @@ -86,7 +86,7 @@ class TestClientApiInterface(TestClientA 'http://127.0.0.1:4002', 'http://127.0.0.1:4003'] d = ','.join(data) mocker.return_value = self._prepare_response(200, d) - self.assertEquals(data, self.client.machines) + self.assertEqual(data, self.client.machines) @mock.patch('etcd.Client.machines', new_callable=mock.PropertyMock) def test_use_proxies(self, mocker): @@ -101,8 +101,8 @@ class TestClientApiInterface(TestClientA use_proxies=True ) - self.assertEquals(c._machines_cache, ['https://localproxy:4001']) - self.assertEquals(c._base_uri, 'https://localhost:4001') + self.assertEqual(c._machines_cache, ['https://localproxy:4001']) + self.assertEqual(c._base_uri, 'https://localhost:4001') self.assertNotIn(c.base_uri, c._machines_cache) c = etcd.Client( @@ -128,7 +128,7 @@ class TestClientApiInterface(TestClientA ] } self._mock_api(200, data) - self.assertEquals(self.client.members["ce2a822cea30bfca"]["id"], "ce2a822cea30bfca") + self.assertEqual(self.client.members["ce2a822cea30bfca"]["id"], "ce2a822cea30bfca") def test_self_stats(self): """ Request for stats """ @@ -148,13 +148,13 @@ class TestClientApiInterface(TestClientA "state": "StateFollower" } self._mock_api(200,data) - self.assertEquals(self.client.stats['name'], "node3") + self.assertEqual(self.client.stats['name'], "node3") def test_leader_stats(self): """ Request for leader stats """ data = {"leader": "924e2e83e93f2560", "followers": {}} self._mock_api(200,data) - self.assertEquals(self.client.leader_stats['leader'], "924e2e83e93f2560") + self.assertEqual(self.client.leader_stats['leader'], "924e2e83e93f2560") @mock.patch('etcd.Client.members', new_callable=mock.PropertyMock) @@ -163,7 +163,7 @@ class TestClientApiInterface(TestClientA members = {"ce2a822cea30bfca": {"id": "ce2a822cea30bfca", "name": "default"}} mocker.return_value = members self._mock_api(200, {"leaderInfo":{"leader": "ce2a822cea30bfca", "followers": {}}}) - self.assertEquals(self.client.leader, members["ce2a822cea30bfca"]) + self.assertEqual(self.client.leader, members["ce2a822cea30bfca"]) def test_set_plain(self): """ Can set a value """ @@ -179,7 +179,7 @@ class TestClientApiInterface(TestClientA self._mock_api(200, d) res = self.client.write('/testkey', 'test') - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_update(self): """Can update a result.""" @@ -198,7 +198,7 @@ class TestClientApiInterface(TestClientA d['node']['value'] = 'ciao' self._mock_api(200,d) newres = self.client.update(res) - self.assertEquals(newres.value, 'ciao') + self.assertEqual(newres.value, 'ciao') def test_newkey(self): """ Can set a new value """ @@ -215,7 +215,7 @@ class TestClientApiInterface(TestClientA self._mock_api(201, d) res = self.client.write('/testkey', 'test') d['node']['newKey'] = True - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_refresh(self): """ Can refresh a new value """ @@ -232,7 +232,7 @@ class TestClientApiInterface(TestClientA self._mock_api(200, d) res = self.client.refresh('/testkey', ttl=600) - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_not_found_response(self): """ Can handle server not found response """ @@ -253,7 +253,7 @@ class TestClientApiInterface(TestClientA self._mock_api(200, d) res = self.client.write('/testkey', 'test', prevValue='test_old') - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_compare_and_swap_failure(self): """ Exception will be raised if prevValue != value in test_set """ @@ -279,7 +279,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(201, d) res = self.client.write('/testdir', 'test') - self.assertEquals(res.createdIndex, 190) + self.assertEqual(res.createdIndex, 190) def test_set_dir_with_value(self): """ Creating a directory with a value raises an error. """ @@ -298,7 +298,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(200, d) res = self.client.delete('/testKey') - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_pop(self): """ Can pop a value """ @@ -316,7 +316,7 @@ class TestClientApiInterface(TestClientA self._mock_api(200, d) res = self.client.pop(d['node']['key']) - self.assertEquals({attr: getattr(res, attr) for attr in dir(res) + self.assertEqual({attr: getattr(res, attr) for attr in dir(res) if attr in etcd.EtcdResult._node_props}, d['prevNode']) self.assertEqual(res.value, d['prevNode']['value']) @@ -332,7 +332,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(200, d) res = self.client.read('/testKey') - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_get_dir(self): """Can get values in dirs""" @@ -358,7 +358,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(200, d) res = self.client.read('/testDir', recursive=True) - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_not_in(self): """ Can check if key is not in client """ @@ -390,7 +390,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(200, d) res = self.client.read('/testkey', wait=True) - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) def test_watch_index(self): """ Can watch a key starting from the given Index """ @@ -404,7 +404,7 @@ class TestClientApiInterface(TestClientA } self._mock_api(200, d) res = self.client.read('/testkey', wait=True, waitIndex=True) - self.assertEquals(res, etcd.EtcdResult(**d)) + self.assertEqual(res, etcd.EtcdResult(**d)) class TestClientRequest(TestClientApiInterface):
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor