def test_no_exporter_for_type(self): @codec.register_exporter('abc', Part) class Abc(codec.Exporter): pass with self.assertRaises(TypeError): codec.get_exporter(CubeStack(), 'abc') # assembly
def test_get_registered_subtype(self): @codec.register_exporter('abc', Component) class Abc(codec.Exporter): pass self.assertIsInstance(codec.get_exporter(Box(), 'abc'), Abc) # Part
def test_get_registered(self): @codec.register_exporter('abc', Part) class Abc(codec.Exporter): pass self.assertIsInstance(codec.get_exporter(Box(), 'abc'), Abc)
def test_no_exporter(self): with self.assertRaises(TypeError): codec.get_exporter(Box(), 'abc')