예제 #1
0
    def test_ipfs(self):
        json_data = {"name": "giacomo"}
        ipfs = Ipfs()
        # create an ipfs object
        ipfs_hash = ipfs.post(json_data)
        # retrieve ipfs object
        ipfs_json_data = ipfs.get(ipfs_hash)
        self.assertEquals(json_data.get("name"), ipfs_json_data.get("name"))

        with self.assertRaises(ErrorResponse):
            ipfs.get("invalidhash")
예제 #2
0
 def get_event_description(self, ipfs_hash):
     """Returns the IPFS event_description object"""
     ipfs = Ipfs()
     return ipfs.get(ipfs_hash)