Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions test-project/main.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
"""
Simple Python application for testing autonomous agent - Test Scenario 1

BUG: Missing json import (simple fix, should work in 1 attempt)
"""
import json
from datetime import datetime

def calculate_age(birth_year):
"""Calculate age from birth year"""
"""Calculate age based on birth year."""
current_year = datetime.now().year
return current_year - birth_year
age = current_year - birth_year
return age

def format_greeting(name, birth_year):
"""Format a greeting with age"""
"""Format a greeting with name and age."""
age = calculate_age(birth_year)
# BUG: Missing import for json module (agent should fix this easily)
greeting = f"Hello, {name}! You are {age} years old."

# Format as JSON for API response
data = json.dumps({
"greeting": greeting,
"name": name,
"age": age,
"timestamp": datetime.now().isoformat()
"age": age
})
return data

if __name__ == "__main__":
result = format_greeting("Test User", 1990)
result = format_greeting("World", 2000)
print(result)