Pyzotero: a Python client for the Zotero API pyzotero.readthedocs.io
zotero

Add @staticmethod to item_attachment_link_modes

+13
+1
src/pyzotero/_client.py
··· 1041 1041 query_string = "/itemFields" 1042 1042 return query_string, params 1043 1043 1044 + @staticmethod 1044 1045 def item_attachment_link_modes(): 1045 1046 """Get all available link mode types. 1046 1047
+12
tests/test_zotero.py
··· 684 684 request = httpretty.last_request() 685 685 self.assertEqual(request.headers["If-Unmodified-Since-Version"], "5") 686 686 687 + def testItemAttachmentLinkModes(self): 688 + """Tests that item_attachment_link_modes returns expected values""" 689 + # Should work as class method 690 + modes = z.Zotero.item_attachment_link_modes() 691 + self.assertEqual( 692 + modes, ["imported_file", "imported_url", "linked_file", "linked_url"] 693 + ) 694 + # Should also work on instance 695 + zot = z.Zotero("myuserID", "user", "myuserkey") 696 + modes_from_instance = zot.item_attachment_link_modes() 697 + self.assertEqual(modes, modes_from_instance) 698 + 687 699 @httpretty.activate 688 700 def testItemCreation(self): 689 701 """Tests creation of a new item using a template"""