(self, name, contents, display, content_type=None)
| 907 | class TestFileUpload(unittest.TestCase): |
| 908 | |
| 909 | def assertFile(self, name, contents, display, content_type=None): |
| 910 | if isinstance(name, bytes): |
| 911 | text_name = name.decode('ascii') |
| 912 | else: |
| 913 | text_name = name |
| 914 | self.assertIn("<p>You selected '" + text_name + "'</p>", |
| 915 | display, display) |
| 916 | if isinstance(contents, bytes): |
| 917 | text_contents = contents.decode('ascii') |
| 918 | else: |
| 919 | text_contents = contents |
| 920 | self.assertIn("<p>with contents: '" + text_contents + "'</p>", |
| 921 | display, display) |
| 922 | if content_type: |
| 923 | self.assertIn("<p>with content type: '" + content_type + "'</p>", |
| 924 | display, display) |
| 925 | |
| 926 | def test_no_uploads_error(self): |
| 927 | app = webtest.TestApp(SingleUploadFileApp()) |
no outgoing calls
no test coverage detected