Пример #1
0
 def test_filter_tags(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('math', self.scopes[5],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['title'],
                     "Mathematics")
Пример #2
0
 def test_filter_collections_len(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('semiosis', self.scopes[4],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['title'],
                     "Epi Semiosis in Vergil")
Пример #3
0
 def test_filter_notes(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('follow values', self.scopes[3],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['subtitle'],
         "Putnam. 1995. Attachments: 1")
Пример #4
0
 def test_filter_titles(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('ποδιαία', self.scopes[2],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['title'],
                     "In what proof would a geometer use the ποδιαία ?")
Пример #5
0
 def test_filter_creators(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('rösen', self.scopes[1],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['title'],
                     "Making mockery: the poetics of ancient satire")
Пример #6
0
 def test_filter_general(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('fernandez biosemio', self.scopes[0],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     self.assertEqual(res_dct['items']['item']['arg'],
                     "266264_T3IT8DJD")
Пример #7
0
 def test_filter_attachment(self):
     """Test `general` scope"""
     zot_filter = z.ZotFilter('irony kemp', self.scopes[8],
                              test_data=self.data)
     res_dct = capture_output(zot_filter)
     base = "/Users/smargheim/Documents/PDFs/Zotero/"
     path = "kemp_2009_irony and aequabilitas _journal article.pdf"
     self.assertEqual(res_dct['items']['item']['arg'],
         base + path)
Пример #8
0
 def test_filter_intag(self):
     """Test `general` scope"""
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     z.ZotFilter('aequabilitas', self.scopes[7],
                     test_data=self.data, test_group="UZG6NWWI")
     sys.stdout = old_stdout
     res_dct = xmltodict.parse(mystdout.getvalue())
     self.assertEqual(res_dct['items']['item']['icon'],
                     "icons/att_article.png")
Пример #9
0
 def test_filter_incollection(self):
     """Test `general` scope"""
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     z.ZotFilter('horace', self.scopes[6],
                 test_data=self.data, test_group="K4Q262P7")
     sys.stdout = old_stdout
     res_dct = xmltodict.parse(mystdout.getvalue())
     self.assertEqual(res_dct['items']['item']['subtitle'],
                     "Sharland. 2009.")