def test_no_importer_for_type(self): @codec.register_importer('abc', Part) class Abc(codec.Importer): pass with self.assertRaises(TypeError): codec.get_importer(CubeStack, 'abc')
def test_get_registered_subtype(self): @codec.register_importer('abc', Component) class Abc(codec.Importer): pass self.assertIsInstance(codec.get_importer(Box, 'abc'), Abc)
def test_no_importer(self): with self.assertRaises(TypeError): codec.get_importer(Box, 'abc')
def test_get_registered(self): @codec.register_importer('abc', Part) class Abc(codec.Importer): pass self.assertIsInstance(codec.get_importer(Box, 'abc'), Abc)