コード例 #1
0
ファイル: test_reftree.py プロジェクト: mgedmin/dozer
 def test_get_repr_unrepresentable(self):
     # repr(Exception('foo')) is "Exception('foo',)" on Python < 3.7
     # repr(Exception('foo')) is "Exception('foo')" on Python >= 3.7
     self.assertEqual(
         get_repr(Unrepresentable()).replace(',)', ')'),
         "unrepresentable object: Exception('haha you cannot represent me')"
     )
コード例 #2
0
def get_repr(obj, limit=250):
    return cgi.escape(reftree.get_repr(obj, limit))
コード例 #3
0
ファイル: leak.py プロジェクト: wfxiang08/dozer
def get_repr(obj, limit=250):
    return cgi.escape(reftree.get_repr(obj, limit))
コード例 #4
0
ファイル: test_reftree.py プロジェクト: boneyao/dozer
 def test_get_repr_unrepresentable(self):
     self.assertEqual(
         get_repr(Unrepresentable()),
         "unrepresentable object: Exception('haha you cannot represent me',)")
コード例 #5
0
 def test_get_repr_unrepresentable(self):
     self.assertEqual(
         get_repr(Unrepresentable()),
         "unrepresentable object: Exception('haha you cannot represent me',)"
     )