Show More
The requested changes are too big and content was truncated. Show full diff
@@ -960,7 +960,7 b' class MimeBundleFormatter(BaseFormatter):' | |||
|
960 | 960 | if method is not None: |
|
961 | 961 | d = {} |
|
962 | 962 | d['include'] = include |
|
963 |
d['exclude'] = |
|
|
963 | d['exclude'] = exclude | |
|
964 | 964 | return method(**d) |
|
965 | 965 | return None |
|
966 | 966 | else: |
@@ -116,8 +116,6 b' def test_for_type():' | |||
|
116 | 116 | def test_for_type_string(): |
|
117 | 117 | f = PlainTextFormatter() |
|
118 | 118 | |
|
119 | mod = C.__module__ | |
|
120 | ||
|
121 | 119 | type_str = '%s.%s' % (C.__module__, 'C') |
|
122 | 120 | |
|
123 | 121 | # initial return, None |
@@ -166,7 +164,6 b' def test_lookup_by_type():' | |||
|
166 | 164 | f = PlainTextFormatter() |
|
167 | 165 | f.for_type(C, foo_printer) |
|
168 | 166 | nt.assert_is(f.lookup_by_type(C), foo_printer) |
|
169 | type_str = '%s.%s' % (C.__module__, 'C') | |
|
170 | 167 | with nt.assert_raises(KeyError): |
|
171 | 168 | f.lookup_by_type(A) |
|
172 | 169 | |
@@ -475,6 +472,31 b' def test_repr_mime():' | |||
|
475 | 472 | nt.assert_equal(d['image/png'], 'i-overwrite', '_repr_mimebundle_ take precedence') |
|
476 | 473 | |
|
477 | 474 | |
|
475 | ||
|
476 | def test_pass_correct_include_exclude(): | |
|
477 | class Tester(object): | |
|
478 | ||
|
479 | def __init__(self, include=None, exclude=None): | |
|
480 | self.include = include | |
|
481 | self.exclude = exclude | |
|
482 | ||
|
483 | def _repr_mimebundle_(self, include, exclude, **kwargs): | |
|
484 | if include and (include != self.include): | |
|
485 | raise ValueError('include got modified: display() may be broken.') | |
|
486 | if exclude and (exclude != self.exclude): | |
|
487 | raise ValueError('exclude got modified: display() may be broken.') | |
|
488 | ||
|
489 | return None | |
|
490 | ||
|
491 | include = {'a', 'b', 'c'} | |
|
492 | exclude = {'c', 'e' , 'f'} | |
|
493 | ||
|
494 | f = get_ipython().display_formatter | |
|
495 | f.format(Tester(include=include, exclude=exclude), include=include, exclude=exclude) | |
|
496 | f.format(Tester(exclude=exclude), exclude=exclude) | |
|
497 | f.format(Tester(include=include), include=include) | |
|
498 | ||
|
499 | ||
|
478 | 500 | def test_repr_mime_meta(): |
|
479 | 501 | class HasReprMimeMeta(object): |
|
480 | 502 | def _repr_mimebundle_(self, include=None, exclude=None): |
@@ -499,5 +521,3 b' def test_repr_mime_meta():' | |||
|
499 | 521 | 'height': 10, |
|
500 | 522 | } |
|
501 | 523 | }) |
|
502 | ||
|
503 |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
General Comments 0
You need to be logged in to leave comments.
Login now