async def send_clear_cache_request(self): # 发送 请求 send_boot_notification print("hello") request = call.ClearCachePayload() response = await self.call(request) if response.status == ClearCacheStatus.accepted: print("Clear cache Done!!!!!!!!.") print("it works")
async def send_clear_cache_request(self): print("1.hello, clear cache request send to client") request = call.ClearCachePayload() response = await self.call(request) # print(response) if response.status == ClearCacheStatus.accepted: print("3.we can Clear cache") elif response.status == ClearCacheStatus.rejected: print("client rejected to clear cache")
async def test_suppress_call_error(base_central_system): """ Test that getting a CallError will suppress Exception by default """ call_error = CallError( unique_id='1337', error_code="GenericError", error_description='test_raise_call_error', ) await base_central_system.route_message(call_error.to_json()) payload = call.ClearCachePayload() await base_central_system.call(payload)
async def send_clear_cache_request(self): print("1.hello, clear cache request send to client") request = call.ClearCachePayload() self.export_json_file(request.__dict__, "./dataFromServer2Cp", "ClearCache.req") response = await self.call(request) print(response.__dict__) self.export_json_file(response.__dict__, "./dataFromServer2Cp", "ClearCache.con") if response.status == ClearCacheStatus.accepted: print("3.we can Clear cache") elif response.status == ClearCacheStatus.rejected: print("3.client rejected to clear cache")
async def test_raise_call_error(base_central_system): """ Test that getting a CallError will raise an Exception if suppress argument is not True. """ call_error = CallError( unique_id='1337', error_code="GenericError", error_description='test_raise_call_error', ) await base_central_system.route_message(call_error.to_json()) payload = call.ClearCachePayload() with pytest.raises(GenericError): await base_central_system.call(payload, suppress=False)
async def send_clear_cache(self) -> call_result.ClearCachePayload: return await self.call(call.ClearCachePayload())