ruff
This commit is contained in:
parent
8dc358da39
commit
7ebe8563c5
1 changed files with 10 additions and 9 deletions
|
|
@ -288,12 +288,13 @@ if __name__ == "__main__":
|
|||
self.id = user_id
|
||||
|
||||
@log_usage(function_name="example_with_user", log_type="example")
|
||||
async def example_with_user(data: str, user: MockUser, wrong_param=datetime.utcnow().isoformat()):
|
||||
async def example_with_user(
|
||||
data: str, user: MockUser, wrong_param=datetime.utcnow().isoformat()
|
||||
):
|
||||
"""Example function with user parameter."""
|
||||
await asyncio.sleep(0.05)
|
||||
return float("nan")
|
||||
|
||||
|
||||
@log_usage(function_name="returns_cycle", log_type="function")
|
||||
async def returns_cycle():
|
||||
a = []
|
||||
|
|
@ -314,7 +315,9 @@ if __name__ == "__main__":
|
|||
# Example 2: Function with user
|
||||
print("\n2. Running example function with user:")
|
||||
mock_user = MockUser("example-user-123")
|
||||
result2 = await example_with_user("sample_data", user=mock_user, wrong_param=datetime.utcnow().isoformat())
|
||||
result2 = await example_with_user(
|
||||
"sample_data", user=mock_user, wrong_param=datetime.utcnow().isoformat()
|
||||
)
|
||||
result3 = await example_with_user("sample_data", user=mock_user)
|
||||
|
||||
print(f" Result: {result2}")
|
||||
|
|
@ -353,7 +356,5 @@ if __name__ == "__main__":
|
|||
print(" - CACHE_HOST=localhost")
|
||||
print(" - CACHE_PORT=6379")
|
||||
|
||||
|
||||
|
||||
# Run the example
|
||||
asyncio.run(run_example())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue