def test_decide_format_template(self):
        """ bibformat - choice made by function decide_format_template"""
        result = bibformat_engine.decide_format_template(self.bfo_1, "test1")
        self.assertEqual(result, "Thesis_detailed.bft")

        result = bibformat_engine.decide_format_template(self.bfo_3, "test3")
        self.assertEqual(result, "Test3.bft")

        #Only default matches
        result = bibformat_engine.decide_format_template(self.bfo_2, "test1")
        self.assertEqual(result, "Default_HTML_detailed.bft")

        #No match at all for record
        result = bibformat_engine.decide_format_template(self.bfo_2, "test2")
        self.assertEqual(result, None)

        #Non existing output format
        result = bibformat_engine.decide_format_template(self.bfo_2, "UNKNOW")
        self.assertEqual(result, None)
    def test_decide_format_template(self):
        """ bibformat - choice made by function decide_format_template"""
        result = bibformat_engine.decide_format_template(self.bfo_1, "test1")
        self.assertEqual(result, "Thesis_detailed.bft")

        result = bibformat_engine.decide_format_template(self.bfo_3, "test3")
        self.assertEqual(result, "Test3.bft")

        #Only default matches
        result = bibformat_engine.decide_format_template(self.bfo_2, "test1")
        self.assertEqual(result, "Default_HTML_detailed.bft")

        #No match at all for record
        result = bibformat_engine.decide_format_template(self.bfo_2, "test2")
        self.assertEqual(result, None)

        #Non existing output format
        result = bibformat_engine.decide_format_template(self.bfo_2, "UNKNOW")
        self.assertEqual(result, None)
    def test_decide_format_template(self):
        """ bibformat - choice made by function decide_format_template"""
        result = bibformat_engine.decide_format_template(self.bfo_1, "test1")
        self.assertEqual(result, "Thesis_detailed.bft")

        result = bibformat_engine.decide_format_template(self.bfo_3, "test3")
        self.assertEqual(result, "Test3.bft")

        #Only default matches
        result = bibformat_engine.decide_format_template(self.bfo_2, "test1")
        self.assertEqual(result, "Default_HTML_detailed.bft")

        #No match at all for record
        result = bibformat_engine.decide_format_template(self.bfo_2, "test2")
        self.assertEqual(result, None)

        #Non existing output format
        try:
            result = bibformat_engine.decide_format_template(self.bfo_2, "UNKNOW")
        except bibformat_engine.InvenioBibFormatError:
            pass
        else:
            self.fail("Should have raised InvenioBibFormatError")
Example #4
0
    def test_decide_format_template(self):
        """ bibformat - choice made by function decide_format_template"""
        result = bibformat_engine.decide_format_template(self.bfo_1, "test1")
        self.assertEqual(result, "Thesis_detailed.bft")

        result = bibformat_engine.decide_format_template(self.bfo_3, "test3")
        self.assertEqual(result, "Test3.bft")

        #Only default matches
        result = bibformat_engine.decide_format_template(self.bfo_2, "test1")
        self.assertEqual(result, "Default_HTML_detailed.bft")

        #No match at all for record
        result = bibformat_engine.decide_format_template(self.bfo_2, "test2")
        self.assertEqual(result, None)

        #Non existing output format
        try:
            result = bibformat_engine.decide_format_template(
                self.bfo_2, "UNKNOW")
        except bibformat_engine.InvenioBibFormatError:
            pass
        else:
            self.fail("Should have raised InvenioBibFormatError")