Example #1
0
 def test_get_multipart_formdata_inputs_with_files(self):
     f = io.StringIO(u"test file contents")
     g = io.StringIO(u"test file contents")
     req = Request.blank('/filesize', POST={'data': ('test', f)})
     func = FireflyFunction(dummy)
     d = func.get_multipart_formdata_inputs(req)
     assert d['data'].read().decode() == g.read()
Example #2
0
    def test_get_multipart_formdata_inputs_with_no_files(self):
        def dummy():
            pass

        req = Request.blank('/filesize', POST={'abc': 'hi', 'xyz': 1})
        func = FireflyFunction(dummy)
        d = func.get_multipart_formdata_inputs(req)
        assert d['abc'] == 'hi'
        assert d['xyz'] == '1'