Esempio n. 1
0
 def testLinks(self):
     """testing INSPIRE Links"""
     from bfe_INSPIRE_links import format_element
     self.bfo=BibFormatObject('1')
     string = format_element(self.bfo, separator='</li>\n<li>', prefix="<ul><li>",suffix="</li></ul>")
     self.assert_(re.search(r'1012.0299">Abstract<',string))
     self.assert_(re.search(r'arXiv:1012.0299">PDF</a> from arXiv.org',string))
Esempio n. 2
0
 def testarXiv(self):
     """INSPIRE arXiv format"""
     from bfe_INSPIRE_arxiv import format_element
     self.bfo = BibFormatObject('1')
     string = format_element(self.bfo)
     self.assert_(re.search(r'0299',string))
     self.assert_(not re.search(r'CERN',string))
     self.assert_(re.search(r'hep-th',string))
Esempio n. 3
0
 def testarXiv(self):
     """INSPIRE arXiv format"""
     from bfe_INSPIRE_arxiv import format_element
     self.bfo = BibFormatObject('1')
     string = format_element(self.bfo)
     self.assert_(re.search(r'0299', string))
     self.assert_(not re.search(r'CERN', string))
     self.assert_(re.search(r'hep-th', string))
Esempio n. 4
0
 def testLinks(self):
     """testing INSPIRE Links"""
     from bfe_INSPIRE_links import format_element
     self.bfo = BibFormatObject('1')
     string = format_element(self.bfo,
                             separator='</li>\n<li>',
                             prefix="<ul><li>",
                             suffix="</li></ul>")
     self.assert_(re.search(r'1012.0299">Abstract<', string))
     self.assert_(
         re.search(r'arXiv:1012.0299">PDF</a> from arXiv.org', string))
Esempio n. 5
0
 def testDate(self):
     """INSPIRE date format"""
     from bfe_INSPIRE_date import format_element, parse_date
     # Test parse date function
     self.assert_(not parse_date(None))
     self.assert_(not parse_date(""))
     self.assert_(not parse_date("This is bad input"))
     self.assert_(not parse_date([1,2,4,"test"]))
     self.assert_(parse_date("2003-05-02") == (2003,5,2))
     self.assert_(parse_date("20030502") == (2003,5,2))
     self.assert_(parse_date("2003-05") == (2003,5))
     self.assert_(parse_date("200305") == (2003,5))
     self.assert_(parse_date("2003") == (2003,))
     # Expect date from 269__$$c
     self.bfo = BibFormatObject('1')
     string = format_element(self.bfo)
     self.assert_(re.search(r'Dec 2010',string))
Esempio n. 6
0
 def testDate(self):
     """INSPIRE date format"""
     from bfe_INSPIRE_date import format_element, parse_date
     # Test parse date function
     self.assert_(not parse_date(None))
     self.assert_(not parse_date(""))
     self.assert_(not parse_date("This is bad input"))
     self.assert_(not parse_date([1, 2, 4, "test"]))
     self.assert_(parse_date("2003-05-02") == (2003, 5, 2))
     self.assert_(parse_date("20030502") == (2003, 5, 2))
     self.assert_(parse_date("2003-05") == (2003, 5))
     self.assert_(parse_date("200305") == (2003, 5))
     self.assert_(parse_date("2003") == (2003, ))
     # Expect date from 269__$$c
     self.bfo = BibFormatObject('1')
     string = format_element(self.bfo)
     self.assert_(re.search(r'Dec 2010', string))