Commits

Shu Zong Chen committed b7dcd0e

Updated README to reflect new upload function

  • Participants
  • Parent commits b915aae

Comments (0)

Files changed (2)

       tasklist_id = tasklist_id,
     )
 
+
+::
+    
+    # UPLOADING A FILE
+    with open("tests/files/archer.jpg", 'rb') as fh:
+      r = self.apollo.upload("archer.jpg", fh)
+    upload_id = r.data['attachment-id']
+
+    # WRITE MSG WITH UPLOAD
+    r = self.apollo.post(
+      "projects/{project_id}/messages",
+      project_id = project_id,
+      data = {
+        "message": {
+          "title": "Test Message",
+          "body": "Archer is so cute!",
+          "attachments": [upload_id,],
+        }
+      }
+    )
+
 Running Tests
 =============
 

File tests/test_apollo.py

 		# UPLOAD
 		with open("tests/files/archer.jpg", 'rb') as fh:
 			r = self.apollo.upload("archer.jpg", fh)
-			upload_id = r.data['attachment-id']
+		upload_id = r.data['attachment-id']
 
 		# WRITE MSG WITH UPLOAD