~david-goetz/swift/wal_again

« back to all changes in this revision

Viewing changes to test/functional/tests.py

  • Committer: Tarmac
  • Author(s): gholt
  • Date: 2011-06-16 21:12:04 UTC
  • mfrom: (291.19.6 postcopy)
  • mto: This revision was merged to the branch mainline in revision 294.
  • Revision ID: tarmac-20110616211204-s5slh4h8nt9mrd2v
You can specify X-Newest: true on GETs and HEADs to indicate you want Swift to query all backend copies and return the newest version retrieved.
Object COPY requests now always copy the newest object they can find.
Object POSTs are implemented as COPYs now by default (you can revert to previous implementation with conf object_post_as_copy = false)
Account and container GETs and HEADs now shuffle the nodes they use to balance load.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
            headers = dict(self.env.conn.response.getheaders())
228
228
            if format == 'json':
229
229
                self.assertEquals(headers['content-type'],
230
 
                    'application/json; charset=utf8')
 
230
                    'application/json; charset=utf-8')
231
231
            elif format == 'xml':
232
232
                self.assertEquals(headers['content-type'],
233
 
                    'application/xml; charset=utf8')
 
233
                    'application/xml; charset=utf-8')
234
234
 
235
235
    def testListingLimit(self):
236
236
        limit = 10000
1032
1032
                self.assert_(file.write())
1033
1033
                self.assert_status(201)
1034
1034
                self.assert_(file.sync_metadata())
1035
 
                self.assert_status(202)
 
1035
                self.assert_status((201, 202))
1036
1036
            else:
1037
1037
                self.assertRaises(ResponseError, file.write)
1038
1038
                self.assert_status(400)
1245
1245
 
1246
1246
            file.metadata = metadata
1247
1247
            self.assert_(file.sync_metadata())
1248
 
            self.assert_status(202)
 
1248
            self.assert_status((201, 202))
1249
1249
 
1250
1250
            file = self.env.container.file(file.name)
1251
1251
            self.assert_(file.initialize())
1355
1355
            headers = dict(self.env.conn.response.getheaders())
1356
1356
            if format == 'json':
1357
1357
                self.assertEquals(headers['content-type'],
1358
 
                    'application/json; charset=utf8')
 
1358
                    'application/json; charset=utf-8')
1359
1359
            elif format == 'xml':
1360
1360
                self.assertEquals(headers['content-type'],
1361
 
                    'application/xml; charset=utf8')
 
1361
                    'application/xml; charset=utf-8')
1362
1362
 
1363
1363
        lm_diff = max([f['last_modified'] for f in files]) - \
1364
1364
            min([f['last_modified'] for f in files])