def simulate(protocol, headers=None):
        env = testing.create_environ(
            method='GET',
            scheme=protocol,
            path=_TEST_PATH,
            query_string='',
            headers=headers,
        )

        srmock = testing.StartResponseMock()
        iterable = app(env, srmock)

        return testing.Result(iterable, srmock.status, srmock.headers)
예제 #2
0
파일: test_utils.py 프로젝트: vytas7/falcon
 def test_wsgi_iterable_not_closeable(self):
     result = testing.Result([], falcon.HTTP_200, [])
     assert not result.content
     assert result.json is None
예제 #3
0
 def test_wsgi_iterable_not_closeable(self):
     result = testing.Result([], falcon.HTTP_200, [])
     self.assertFalse(result.content)