Пример #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()