Exemplo n.º 1
0
 def test_type_and_adr_w_oid(self):
     from BTrees.utils import oid_repr
     class WithOid(object):
         _p_oid = b'DEADBEEF'
     t_and_a = self._callFUT(WithOid())
     self.assertTrue(t_and_a.startswith('WithOid (0x'))
     self.assertTrue(t_and_a.endswith('oid=%s)' % oid_repr(b'DEADBEEF')))
Exemplo n.º 2
0
    def test_type_and_adr_w_oid(self):
        from BTrees.utils import oid_repr

        class WithOid(object):
            _p_oid = b'DEADBEEF'

        t_and_a = self._callFUT(WithOid())
        self.assertTrue(t_and_a.startswith('WithOid (0x'))
        self.assertTrue(t_and_a.endswith('oid=%s)' % oid_repr(b'DEADBEEF')))
Exemplo n.º 3
0
def type_and_adr(obj):
    if hasattr(obj, '_p_oid'):
        oid = oid_repr(obj._p_oid)
    else:
        oid = 'None'
    return "%s (0x%x oid=%s)" % (type(obj).__name__, positive_id(obj), oid)
Exemplo n.º 4
0
 def _callFUT(self, oid):
     from BTrees.utils import oid_repr
     return oid_repr(oid)
Exemplo n.º 5
0
def type_and_adr(obj):
    if hasattr(obj, '_p_oid'):
        oid = oid_repr(obj._p_oid)
    else:
        oid = 'None'
    return "%s (0x%x oid=%s)" % (type(obj).__name__, positive_id(obj), oid)
Exemplo n.º 6
0
 def _callFUT(self, oid):
     from BTrees.utils import oid_repr
     return oid_repr(oid)