Beispiel #1
0
 def test_zotero_match_and(self):
     """Test Zotero collection matching using logical 'and' operator."""
     path = join('tests', 'data', 'zotero.csv')
     zc = ZoteroCollection()
     zc.load_csv(path)
     m = zc.match({'Key': 'CUZWAHIZ'})
     assert_equal(len(m), 1)
     assert_equal(m[0]['Title'], 'Tarsus kılavuzu')
     m = zc.match({'Item Type': 'blogPost', 'Date': '2009-10-07'})
     assert_equal(
         str(m[0]),
         'ZoteroRecord(6S3UA6RW): "Discoverability .. a report that\'s '
         'worth a look"')
Beispiel #2
0
 def test_zotero_suggest_short_title(self):
     """Test the ZoteroRecord suggest_short_title method."""
     path = join('tests', 'data', 'zotero_sugg.csv')
     zc = ZoteroCollection()
     zc.load_csv(path)
     m = zc.match({'Title': 'Bill and Pete Go Down the Nile.'})
     assert_equal(len(m), 1)
     assert_equal(m[0].suggest_short_title(), 'DePaola 2009')
Beispiel #3
0
 def test_zotero_match_notimplemented(self):
     """Test Zotero collection matching using and unexpected operator."""
     path = join('tests', 'data', 'zotero.csv')
     zc = ZoteroCollection()
     zc.load_csv(path)
     zc.match({'Key': 'CUZWAHIZ'}, operator='foo')