~ubuntu-branches/ubuntu/trusty/python-urllib3/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/01_do-not-use-embedded-python-six.patch/test/test_filepost.py

  • Committer: Package Import Robot
  • Author(s): Daniele Tricoli, Jakub Wilk, Daniele Tricoli
  • Date: 2013-05-11 15:15:38 UTC
  • mfrom: (1.2.1) (4.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20130511151538-4dshl34jt0kkpt9i
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Daniele Tricoli ]
* New upstream release
* Upload to unstable (Closes: #707780)
* debian/control
  - Added python3-six to Build-Depends field
  - Bumped debhelper dependency to 8.1 for build-{arch,indep} support
  - Removed python-setuptools from Build-Depends field
* debian/copyright
  - Updated copyright years
  - Added stanza for urllib3/packages/ordered_dict.py
* debian/patches/01_do-not-use-embedded-python-six.patch
  - Refreshed
* debian/patches/02_require-cert-verification.patch
  - Refreshed
* debian/patches/03_no-setuptools.patch
  - Do not use setuptools
* debian/patches/04_relax_nosetests_options.patch
  - Do not use logging-clear-handlers to see all logging output and
    disabled cover-min-percentage since it require python-nose (>= 1.3):
    this way it will be easier to backport python-urllib3 to Wheezy.
* debian/patches/05_fix_python3_syntax_error_in_ntlmpool.patch
  - Fix syntax error 'unicodeescape' codec can't decode bytes in
    position 130-132 for Python3

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            self.assertEqual(encoded,
53
53
                b'--' + b(BOUNDARY) + b'\r\n'
54
54
                b'Content-Disposition: form-data; name="k"\r\n'
55
 
                b'Content-Type: text/plain\r\n'
56
55
                b'\r\n'
57
56
                b'v\r\n'
58
57
                b'--' + b(BOUNDARY) + b'\r\n'
59
58
                b'Content-Disposition: form-data; name="k2"\r\n'
60
 
                b'Content-Type: text/plain\r\n'
61
59
                b'\r\n'
62
60
                b'v2\r\n'
63
61
                b'--' + b(BOUNDARY) + b'--\r\n'
64
62
                , fields)
65
63
 
66
64
            self.assertEqual(content_type,
67
 
                b'multipart/form-data; boundary=' + b(BOUNDARY))
 
65
                'multipart/form-data; boundary=' + str(BOUNDARY))
68
66
 
69
67
 
70
68
    def test_filename(self):
82
80
            )
83
81
 
84
82
        self.assertEqual(content_type,
85
 
            b'multipart/form-data; boundary=' + b(BOUNDARY))
 
83
            'multipart/form-data; boundary=' + str(BOUNDARY))
 
84
 
 
85
 
 
86
    def test_textplain(self):
 
87
        fields = [('k', ('somefile.txt', b'v'))]
 
88
 
 
89
        encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
 
90
 
 
91
        self.assertEqual(encoded,
 
92
            b'--' + b(BOUNDARY) + b'\r\n'
 
93
            b'Content-Disposition: form-data; name="k"; filename="somefile.txt"\r\n'
 
94
            b'Content-Type: text/plain\r\n'
 
95
            b'\r\n'
 
96
            b'v\r\n'
 
97
            b'--' + b(BOUNDARY) + b'--\r\n'
 
98
            )
 
99
 
 
100
        self.assertEqual(content_type,
 
101
            'multipart/form-data; boundary=' + str(BOUNDARY))
 
102
 
 
103
 
 
104
    def test_explicit(self):
 
105
        fields = [('k', ('somefile.txt', b'v', 'image/jpeg'))]
 
106
 
 
107
        encoded, content_type = encode_multipart_formdata(fields, boundary=BOUNDARY)
 
108
 
 
109
        self.assertEqual(encoded,
 
110
            b'--' + b(BOUNDARY) + b'\r\n'
 
111
            b'Content-Disposition: form-data; name="k"; filename="somefile.txt"\r\n'
 
112
            b'Content-Type: image/jpeg\r\n'
 
113
            b'\r\n'
 
114
            b'v\r\n'
 
115
            b'--' + b(BOUNDARY) + b'--\r\n'
 
116
            )
 
117
 
 
118
        self.assertEqual(content_type,
 
119
            'multipart/form-data; boundary=' + str(BOUNDARY))