diff options
author | Eric Smith <eric@trueblade.com> | 2010-11-06 14:43:26 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2010-11-06 14:43:26 (GMT) |
commit | 72f66208592cabc320854c0a8caa0e90be42beb8 (patch) | |
tree | daf7eee37d148cb15735ab09db9bffce38fe0e00 /Lib/test/test_unicode.py | |
parent | 5ad85f81b0664fafcd936b1dbfb728a3ace8f7a2 (diff) | |
download | cpython-72f66208592cabc320854c0a8caa0e90be42beb8.zip cpython-72f66208592cabc320854c0a8caa0e90be42beb8.tar.gz cpython-72f66208592cabc320854c0a8caa0e90be42beb8.tar.bz2 |
Removed unused test classes from test_format_map().
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index cc891bd..b2794fd 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -720,49 +720,11 @@ class UnicodeTest(string_tests.CommonTest, self.assertEqual('{a}'.format_map(InternalMapping()), 'hello') - # classes we'll use for testing class C: def __init__(self, x=100): self._x = x def __format__(self, spec): return spec - - class D: - def __init__(self, x): - self.x = x - def __format__(self, spec): - return str(self.x) - - # class with __str__, but no __format__ - class E: - def __init__(self, x): - self.x = x - def __str__(self): - return 'E(' + self.x + ')' - - # class with __repr__, but no __format__ or __str__ - class F: - def __init__(self, x): - self.x = x - def __repr__(self): - return 'F(' + self.x + ')' - - # class with __format__ that forwards to string, for some format_spec's - class G: - def __init__(self, x): - self.x = x - def __str__(self): - return "string is " + self.x - def __format__(self, format_spec): - if format_spec == 'd': - return 'G(' + self.x + ')' - return object.__format__(self, format_spec) - - # class that returns a bad type from __format__ - class H: - def __format__(self, format_spec): - return 1.0 - self.assertEqual('{foo._x}'.format_map({'foo': C(20)}), '20') # test various errors |