예제 #1
0
 def test_save_as(self):
     with self.new_document_from_file() as d:
         d.author_attachments.add(AA(u'document.pdf',
                                     self.test_doc_contents))
         d = self.api.update_document(d)
         raa = list(d.author_attachments)[0]
         with utils.temporary_file_path() as file_path:
             raa.save_as(file_path)
             with open(file_path, 'rb') as f:
                 self.assertPDFsEqual(f.read(), self.test_doc_contents)
예제 #2
0
 def test_save_as(self):
     with self.new_document_from_file() as d:
         d.author_attachments.add(
             AA(u'document.pdf', self.test_doc_contents))
         d = self.api.update_document(d)
         raa = list(d.author_attachments)[0]
         with utils.temporary_file_path() as file_path:
             raa.save_as(file_path)
             with open(file_path, 'rb') as f:
                 self.assertPDFsEqual(f.read(), self.test_doc_contents)
예제 #3
0
 def test_save_as(self):
     with self.new_document_from_file() as d:
         with utils.temporary_file_path() as file_path:
             d.original_file.save_as(file_path)
             with open(file_path, 'rb') as f:
                 self.assertPDFsEqual(f.read(), self.test_doc_contents)
예제 #4
0
 def test_save_as(self):
     with utils.temporary_file_path() as file_path:
         self.file_.save_as(file_path)
         with open(file_path, 'rb') as f:
             self.assertEqual(self.test_doc_contents, f.read())
예제 #5
0
 def test_save_as(self):
     with self.new_document_from_file() as d:
         with utils.temporary_file_path() as file_path:
             d.original_file.save_as(file_path)
             with open(file_path, 'rb') as f:
                 self.assertPDFsEqual(f.read(), self.test_doc_contents)
예제 #6
0
 def test_save_as(self):
     with utils.temporary_file_path() as file_path:
         self.file_.save_as(file_path)
         with open(file_path, 'rb') as f:
             self.assertEqual(self.test_doc_contents, f.read())