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

Method test_post_upload_empty_files

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

Source from the content-addressed store, hash-verified

1084 "<p>with contents: 'content'</p>")
1085
1086 def test_post_upload_empty_files(self):
1087 app = webtest.TestApp(SingleUploadFileApp())
1088 resp = app.post(
1089 '/',
1090 upload_files=[('file', 'filename', b'')]
1091 )
1092 resp.mustcontain("<p>You selected 'filename'</p>",
1093 "<p>with contents: ''</p>")
1094 resp = app.get('/')
1095 form = resp.form
1096 form['file-field'] = Upload('filename', b'', 'text/plain')
1097 resp = form.submit()
1098 resp.mustcontain("<p>You selected 'filename'</p>",
1099 "<p>with contents: ''</p>")
1100
1101 def test_multiple_file(self):
1102 uploaded_file_name_1 = os.path.join(os.path.dirname(__file__),

Callers

nothing calls this directly

Calls 6

postMethod · 0.95
getMethod · 0.95
UploadClass · 0.90
SingleUploadFileAppClass · 0.85
mustcontainMethod · 0.80
submitMethod · 0.80

Tested by

no test coverage detected