MCPcopy
hub / github.com/pallets/werkzeug / test_proxy_string_representations

Function test_proxy_string_representations

tests/test_local.py:234–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233
234def test_proxy_string_representations():
235 class Example:
236 def __repr__(self):
237 return "a"
238
239 def __bytes__(self):
240 return b"b"
241
242 def __index__(self):
243 return 23
244
245 _, p = _make_proxy(Example())
246 assert str(p) == "a"
247 assert repr(p) == "a"
248 assert bytes(p) == b"b"
249 # __index__
250 assert bin(p) == "0b10111"
251 assert oct(p) == "0o27"
252 assert hex(p) == "0x17"
253
254
255def test_proxy_hash():

Callers

nothing calls this directly

Calls 2

_make_proxyFunction · 0.85
ExampleClass · 0.85

Tested by

no test coverage detected