##// END OF EJS Templates
try to shutdown at the end of every notebook run...
try to shutdown at the end of every notebook run this line causes noise in the test suite, but if we just ignore it, we'll never get to the bottom of it. It seems to only happen when running 'iptest js', and *not* when running the 'casperjs test' command directly, with a notebookserver that was launched manually.

File last commit:

r11936:9b5a6a06
r13288:f4ebc6b7
Show More
test_datatypefilter.py
46 lines | 1.5 KiB | text/x-python | PythonLexer
Jonathan Frederic
Added some filter tests
r11481 """
Module with tests for DataTypeFilter
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from ...tests.base import TestsBase
from ..datatypefilter import DataTypeFilter
#-----------------------------------------------------------------------------
# Class
#-----------------------------------------------------------------------------
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()
Jonathan Frederic
Don't check explicit output, instead see if output contains what we want
r11915 assert "png" in filter(["hair", "water", "png", "rock"])
assert "pdf" in filter(["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([]), [])