prayagverma / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

testWorksheetCRUD broken if UpdateWorksheet used twice #665

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Option 1: What steps will reproduce the problem?
1. Apply this patch to the code base to modify a test:

diff -r 624d33ad26f2 tests/gdata_tests/spreadsheet/service_test.py
--- a/tests/gdata_tests/spreadsheet/service_test.py Mon Feb 11 12:47:58 2013 
-0800
+++ b/tests/gdata_tests/spreadsheet/service_test.py Thu May 30 13:07:35 2013 
+0200
@@ -194,6 +194,15 @@
     self.assertEquals(edited_worksheet.row_count.text, '2')
     self.assertEquals(edited_worksheet.title.text, 'edited worksheet test12')

+    # Change the dimensions again and title of the new worksheet.
+    new_worksheet.col_count.text = '6'
+    new_worksheet.title.text = 'edited worksheet test123'
+    edited_worksheet = self.gd_client.UpdateWorksheet(new_worksheet)
+    self.assertEquals(edited_worksheet.col_count.text, '6')
+    self.assertEquals(edited_worksheet.row_count.text, '2')
+    self.assertEquals(edited_worksheet.title.text, 'edited worksheet test123')
+
+
     # Delete the new worksheet.
     result = self.gd_client.DeleteWorksheet(edited_worksheet)
     self.assertEquals(result, True)

2. Execute that test
3. Repeat the above point, and it will fail with a 409 error, reason:Conflict

Option 2: What steps will reproduce the problem?
1. Get or create a WorkSheet (called XWorkSheet)
2. Use UpdateWorkSheet with XWorkSheet as parameter
3. Repeat the above point, and it will fail with a 409 error, reason:Conflict

What is the expected output? What do you see instead?
You should be able to update a spredsheet as many times as you want, and it 
only works the first one.

What version of the product are you using?
2.0.17

Please provide any additional information below.

This is the exact code to reproduce the issue:

new_ws=spreadsheets_client.AddWorksheet('test api4', '2', 3, key)
spreadsheets_client.UpdateWorksheet(new_ws)
spreadsheets_client.UpdateWorksheet(new_ws)

Output:

RequestError: {'status': 409, 'body': "<?xml version='1.0' [...] 
<gs:rowCount>2</gs:rowCount><gs:colCount>3</gs:colCount></entry>", 'reason': 
'Conflict'}

Original issue reported on code.google.com by bravejo...@gmail.com on 30 May 2013 at 11:11