예제 #1
0
    def setup(self):
        class NoopHeuristic(BaseHeuristic):
            warning = Mock()

            def update_headers(self, resp_headers, resp_status):
                return {}

        self.heuristic = NoopHeuristic()
        self.async_client = make_async_client(heuristic=self.heuristic)
예제 #2
0
 async def async_client(self, cache):
     async_client = make_async_client(cache=cache)
     yield async_client
     await async_client.aclose()
예제 #3
0
 def setup(self):
     self.async_client = make_async_client(heuristic=ExpiresAfterHeuristic(
         days=1))
예제 #4
0
 def setup(self):
     self.async_client = make_async_client(heuristic=OneDayCacheHeuristic())
예제 #5
0
    def setup(self):
        class DummyHeuristic(BaseHeuristic):
            def update_headers(self, resp_headers, resp_status):
                return {"x-dummy-header": "foobar"}

        self.async_client = make_async_client(heuristic=DummyHeuristic())
예제 #6
0
 def setup(self):
     self.async_client = make_async_client(
         heuristic=LastModifiedHeuristic())
예제 #7
0
 def setup(self):
     self.async_client = make_async_client()