[dbapi] retire repo.entity_metas which was used by the dbapi
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 17 Mar 2015 15:41:54 +0100
changeset 10337 c8bb743850c9
parent 10336 9c38f674e36f
child 10338 f738180d499d
[dbapi] retire repo.entity_metas which was used by the dbapi Related to #3933480.
server/repository.py
server/test/unittest_repository.py
--- a/server/repository.py	Wed Jun 04 18:21:24 2014 +0200
+++ b/server/repository.py	Tue Mar 17 15:41:54 2015 +0100
@@ -664,38 +664,6 @@
         """open a new session for a given user and return its sessionid """
         return self.new_session(login, **kwargs).sessionid
 
-    @deprecated('[3.19] use .entity_metas(sessionid, eid, txid) instead')
-    def describe(self, sessionid, eid, txid=None):
-        """return a tuple `(type, physical source uri, extid, actual source
-        uri)` for the entity of the given `eid`
-
-        As of 3.19, physical source uri is always the system source.
-        """
-        session = self._get_session(sessionid, setcnxset=True, txid=txid)
-        try:
-            etype, extid, source = self.type_and_source_from_eid(eid, session)
-            return etype, source, extid, source
-        finally:
-            session.free_cnxset()
-
-    def entity_metas(self, sessionid, eid, txid=None):
-        """return a dictionary containing meta-datas for the entity of the given
-        `eid`. Available keys are:
-
-        * 'type', the entity's type name,
-
-        * 'source', the name of the source from which this entity's coming from,
-
-        * 'extid', the identifierfor this entity in its originating source, as
-          an encoded string or `None` for entities from the 'system' source.
-        """
-        session = self._get_session(sessionid, setcnxset=True, txid=txid)
-        try:
-            etype, extid, source = self.type_and_source_from_eid(eid, session)
-            return {'type': etype, 'source': source, 'extid': extid}
-        finally:
-            session.free_cnxset()
-
     def check_session(self, sessionid):
         """raise `BadConnectionId` if the connection is no more valid, else
         return its latest activity timestamp.
--- a/server/test/unittest_repository.py	Wed Jun 04 18:21:24 2014 +0200
+++ b/server/test/unittest_repository.py	Tue Mar 17 15:41:54 2015 +0100
@@ -240,12 +240,8 @@
         repo = self.repo
         cnxid = repo.connect(self.admlogin, password=self.admpassword)
         self.assertEqual(repo.user_info(cnxid), (6, 'admin', set([u'managers']), {}))
-        self.assertEqual({'type': u'CWGroup', 'extid': None, 'source': 'system'},
-                         repo.entity_metas(cnxid, 2))
-        self.assertEqual(repo.describe(cnxid, 2), (u'CWGroup', 'system', None, 'system'))
         repo.close(cnxid)
         self.assertRaises(BadConnectionId, repo.user_info, cnxid)
-        self.assertRaises(BadConnectionId, repo.describe, cnxid, 1)
 
     def test_shared_data_api(self):
         repo = self.repo