Example #1
0
    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
Example #2
0
    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
Example #3
0
    def test_get_registered(self):
        @codec.register_exporter('abc', Part)
        class Abc(codec.Exporter):
            pass

        self.assertIsInstance(codec.get_exporter(Box(), 'abc'), Abc)
Example #4
0
 def test_no_exporter(self):
     with self.assertRaises(TypeError):
         codec.get_exporter(Box(), 'abc')