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

« back to all changes in this revision

Viewing changes to test/unit/common/test_constraints.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:
188
188
        unicode_sample = u'\uc77c\uc601'
189
189
        valid_utf8_str = unicode_sample.encode('utf-8')
190
190
        invalid_utf8_str = unicode_sample.encode('utf-8')[::-1]
 
191
        unicode_with_null = u'abc\u0000def'
 
192
        utf8_with_null = unicode_with_null.encode('utf-8')
191
193
 
192
194
        for false_argument in [None,
193
195
                               '',
194
196
                               invalid_utf8_str,
195
 
                               ]:
 
197
                               unicode_with_null,
 
198
                               utf8_with_null]:
196
199
            self.assertFalse(constraints.check_utf8(false_argument))
197
200
 
198
201
        for true_argument in ['this is ascii and utf-8, too',