Test creation of whole address book
This commit is contained in:
		
							
								
								
									
										12
									
								
								radicale/tests/static/contact_multiple.vcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								radicale/tests/static/contact_multiple.vcf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| BEGIN:VCARD | ||||
| VERSION:3.0 | ||||
| UID:contact1 | ||||
| N:Contact1;;;; | ||||
| FN:Contact1 | ||||
| END:VCARD | ||||
| BEGIN:VCARD | ||||
| VERSION:3.0 | ||||
| UID:contact2 | ||||
| N:Contact2;;;; | ||||
| FN:Contact2 | ||||
| END:VCARD | ||||
| @@ -180,6 +180,16 @@ class BaseRequestsMixIn: | ||||
|         assert "\r\nUID:event\r\n" in answer and "\r\nUID:todo\r\n" in answer | ||||
|         assert "\r\nUID:event1\r\n" not in answer | ||||
|  | ||||
|     def test_put_whole_addressbook(self): | ||||
|         """Create and overwrite a whole addressbook.""" | ||||
|         contacts = get_file_content("contact_multiple.vcf") | ||||
|         status, _, _ = self.request("PUT", "/contacts.vcf/", contacts) | ||||
|         assert status == 201 | ||||
|         status, _, answer = self.request("GET", "/contacts.vcf/") | ||||
|         assert status == 200 | ||||
|         assert ("\r\nUID:contact1\r\n" in answer and | ||||
|                 "\r\nUID:contact2\r\n" in answer) | ||||
|  | ||||
|     def test_delete(self): | ||||
|         """Delete an event.""" | ||||
|         self.request("MKCOL", "/calendar.ics/") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Unrud
					Unrud