Lines Matching refs:Repr
2 Test cases for the repr module
12 from repr import repr as r # Don't shadow builtin repr
13 from repr import Repr
30 expected = repr(s)[:13] + "..." + repr(s)[-14:]
33 eq(r("\"'"), repr("\"'"))
35 expected = repr(s)[:13] + "..." + repr(s)[-14:]
45 r2 = Repr()
47 expected = repr(t3)[:-2] + "...)"
48 eq(r2.repr(t3), expected)
105 eq(r(123), repr(123))
106 eq(r(123L), repr(123L))
107 eq(r(1.0/3), repr(1.0/3))
110 expected = repr(n)[:18] + "..." + repr(n)[-19:]
116 eq(r(i1), repr(i1))
119 expected = repr(i2)[:13] + "..." + repr(i2)[-14:]
132 self.assertTrue(repr(fp).startswith(
135 self.assertTrue(repr(fp).startswith(
139 self.assertTrue(repr(lambda x: x).startswith(
146 eq(repr(hash), '<built-in function hash>')
148 self.assertTrue(repr(''.split).startswith(
153 eq(repr(xrange(1)), 'xrange(1)')
154 eq(repr(xrange(1, 2)), 'xrange(1, 2)')
155 eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)')
179 self.assertTrue(repr(x).startswith('<read-only buffer for 0x'))
188 eq(repr(dict.items), "<method 'items' of 'dict' objects>")
196 self.assertTrue(repr(x).startswith('<staticmethod object at 0x'))
198 self.assertTrue(repr(x).startswith('<classmethod object at 0x'))
201 # Repr.repr() used to call sorted() on sets, frozensets and dicts
250 eq(repr(areallylongpackageandmodulenametotestreprtruncation),
252 eq(repr(sys), "<module 'sys' (built-in)>")
261 eq(repr(foo.foo),
265 # XXX Test the repr of a type with a really long tp_name but with no
276 self.assertTrue(repr(bar.bar).startswith(
286 self.assertTrue(repr(ibaz).startswith(
297 eq(repr(qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod),
301 self.assertTrue(repr(iqux.amethod).startswith(
318 raise Exception("This should be caught by Repr.repr_instance")