~ubuntu-branches/ubuntu/trusty/swift/trusty-updates

« back to all changes in this revision

Viewing changes to test/functionalnosetests/test_object.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-01-28 09:40:30 UTC
  • mfrom: (1.2.16)
  • Revision ID: package-import@ubuntu.com-20130128094030-aetz57x2qz9ye2d4
Tags: 1.7.6-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
 
3
# Copyright (c) 2010-2012 OpenStack, LLC.
 
4
#
 
5
# Licensed under the Apache License, Version 2.0 (the "License");
 
6
# you may not use this file except in compliance with the License.
 
7
# You may obtain a copy of the License at
 
8
#
 
9
#    http://www.apache.org/licenses/LICENSE-2.0
 
10
#
 
11
# Unless required by applicable law or agreed to in writing, software
 
12
# distributed under the License is distributed on an "AS IS" BASIS,
 
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 
14
# implied.
 
15
# See the License for the specific language governing permissions and
 
16
# limitations under the License.
 
17
 
3
18
import unittest
4
19
from nose import SkipTest
5
20
from uuid import uuid4
563
578
        self.assertEquals(resp.getheader('Content-Type'),
564
579
                          'text/html; charset=UTF-8')
565
580
 
 
581
    def test_null_name(self):
 
582
        if skip:
 
583
            raise SkipTest
 
584
 
 
585
        def put(url, token, parsed, conn):
 
586
            conn.request('PUT', '%s/%s/abc%%00def' % (parsed.path,
 
587
                self.container), 'test', {'X-Auth-Token': token})
 
588
            return check_response(conn)
 
589
        resp = retry(put)
 
590
        self.assertEquals(resp.read(), 'Invalid UTF8 or contains NULL')
 
591
        self.assertEquals(resp.status, 412)
 
592
 
566
593
 
567
594
if __name__ == '__main__':
568
595
    unittest.main()