Пример #1
0
 def test_verbose_msg_i44(self):
     """
     Test bug from issue #44
     """
     p = pathlib.Path("test/controls/10.1371__journal.pone.0115069.bib")
     b = NonbibFile(p)
     target = u'Invalid name format: Knauff, , Markus AND Nejasmic, , Jelica'
     self.assertEqual(target, b.verbose_msg())
Пример #2
0
 def test_path_immutability(self):
     """
     Attempting to set `refmanage.NonbibFile.path` should raise AttributeError
     """
     b = NonbibFile(self.invalid)
     try:
         b.path = self.empty
     except AttributeError:
         # Attempting to set `path` attribute raises an error; test passed!
         pass
     else:
         self.fail("NonbibFile.path can be set after instantiation")
Пример #3
0
 def test_src_txt_immutability(self):
     """
     Attempting to set `refmanage.NonbibFile.src_txt` should raise AttributeError
     """
     b = NonbibFile(self.invalid)
     try:
         b.src_txt = "legitimate text string"
     except AttributeError:
         # Attempting to set `path` attribute raises an error; test passed!
         pass
     else:
         self.fail("NonbibFile.src_txt can be set after instantiation")
Пример #4
0
 def test_verbose_msg_invalid_bibtex(self):
     """
     refmanage.NonbibFile.verbose_msg() should return a str of >0 length for an argument pointing to invalid BibTeX.
     """
     b = NonbibFile(self.invalid)
     self.assertGreater(len(b.verbose_msg()), 0)
Пример #5
0
 def test_test_msg_verbose_true(self):
     """
     refmanage.NonbibFile.test_msg(verbose=True) should return unicode
     """
     b = NonbibFile(self.invalid)
     self.assertIsInstance(b.test_msg(True), unicode)
Пример #6
0
 def test_verbose_msg(self):
     """
     refmanage.NonbibFile.verbose_msg() should return a unicode
     """
     b = NonbibFile(self.invalid)
     self.assertIsInstance(b.verbose_msg(), unicode)