MCPcopy Create free account
hub / github.com/Pylons/webtest / test_file_upload_binary

Method test_file_upload_binary

tests/test_forms.py:988–995  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

986 content_type='text/x-custom-type')
987
988 def test_file_upload_binary(self):
989 binary_data = struct.pack('255h', *range(0, 255))
990 app = webtest.TestApp(UploadBinaryApp())
991 res = app.get('/')
992 single_form = res.forms["file_upload_form"]
993 single_form.set("file-field", ('my_file.dat', binary_data))
994 display = single_form.submit("button")
995 self.assertIn(','.join([str(n) for n in range(0, 255)]), display)
996
997 def test_several_file_uploads_with_filename_and_contents(self):
998 uploaded_file1_name = os.path.join(os.path.dirname(__file__),

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
UploadBinaryAppClass · 0.85
setMethod · 0.80
submitMethod · 0.80

Tested by

no test coverage detected