Exemple #1
0
    def test_function(self):
        template = m.TemplateFunction("func")

        template.add_instantiation(int, dummy_a)
        template.add_instantiation(float, dummy_b)

        self.assertEquals(template[int](), 1)
        self.assertEquals(template[float](), 2)
        self.assertEquals(str(template), "<TemplateFunction __main__.func>")
    def test_function(self):
        template = m.TemplateFunction("func")

        template.add_instantiation(int, dummy_a)
        template.add_instantiation(float, dummy_b)

        self.assertEquals(template[int](), 1)
        self.assertEquals(template[float](), 2)
        self.assertEquals(str(template),
                          "<TemplateFunction {}.func>".format(_TEST_MODULE))