##// END OF EJS Templates
Merge pull request #6045 from minrk/nbformat4...
Merge pull request #6045 from minrk/nbformat4 nbformat v4

File last commit:

r18589:135227ac
r18617:482c7bd6 merge
Show More
test_datatypefilter.py
27 lines | 1001 B | text/x-python | PythonLexer
MinRK
move mime-bundle data to rich output.data...
r18589 """Module with tests for DataTypeFilter"""
Jonathan Frederic
Added some filter tests
r11481
MinRK
move mime-bundle data to rich output.data...
r18589 # Copyright (c) IPython Development Team.
Jonathan Frederic
Added some filter tests
r11481 # Distributed under the terms of the Modified BSD License.
from ...tests.base import TestsBase
from ..datatypefilter import DataTypeFilter
Jonathan Frederic
s/Test_/Test
r11494 class TestDataTypeFilter(TestsBase):
Jonathan Frederic
Added some filter tests
r11481 """Contains test functions for datatypefilter.py"""
def test_constructor(self):
"""Can an instance of a DataTypeFilter be created?"""
DataTypeFilter()
def test_junk_types(self):
"""Can the DataTypeFilter pickout a useful type from a list of junk types?"""
filter = DataTypeFilter()
MinRK
move mime-bundle data to rich output.data...
r18589 assert "image/png" in filter(["hair", "water", "image/png", "rock"])
MinRK
remove inappropriate 'pdf' key...
r15383 assert "application/pdf" in filter(["application/pdf", "hair", "water", "png", "rock"])
Jonathan Frederic
Use IPython parameterized testing
r11936 self.assertEqual(filter(["hair", "water", "rock"]), [])
Jonathan Frederic
Added some filter tests
r11481
def test_null(self):
"""Will the DataTypeFilter fail if no types are passed in?"""
filter = DataTypeFilter()
Jonathan Frederic
Use IPython parameterized testing
r11936 self.assertEqual(filter([]), [])