def test_save_and_load(self):
     self.document.load()
     self.document.share_file((REPO+"/data/subdir1/TOtO.txt", True))
     sav_doc = FileDocument(PROFILE_TATA, PROFILE_DIRECTORY)
     sav_doc.import_document(self.document)
     sav_doc.save()
     new_doc = FileDocument(PROFILE_TATA, PROFILE_DIRECTORY)
     new_doc.load()
     container = new_doc.get_container(REPO+u"/data/subdir1")
     self.assert_(dict.has_key(container, "TOtO.txt"))
 def save_profile(self, path=None):
     """save .profile.solipsis"""
     # get file document
     if "file" in self.documents:
         file_doc = self.documents["file"]
     else:
         file_doc = FileDocument()
     # refresh file document to be sure to save updated data
     if "cache" in self.documents:
         file_doc.import_document(self.documents["cache"])
     else:
         print "no cache available"
     # save
     if not path:
         # FIXME: needed for coherency between blog and profile. Refactor
         path = file_doc.file_root
     if path and path.endswith('.prf'):
         path = path[:-4]
     file_doc.save(path)
     # save blog
     self.blogs.save(path)