-
Notifications
You must be signed in to change notification settings - Fork 153
Closed
Labels
openhandsSolving the issue with OpenHands.Solving the issue with OpenHands.
Description
The purpose of this issue is to add tests in tests/integration/tests/*
The tests should inherit from BaseIntegrationTest (tests/integration/base.py) the same way that TypoFixTest does (/tests/integration/tests/t01_fix_simple_typo.py)
Here is a description of the tests to write:
t02_add_bash_hello.pyINSTRUCTION = "Write a shell script '/workspace/hello.sh' that prints 'hello'." Setup:mkdr -p /workspacet03_jupyter_write_file.pyINSTRUCTION = "Use Jupyter IPython to write a text file containing 'hello world' to '/workspace/test.txt'." Setup:mkdr -p /workspacet04_git_staging.pyINSTRUCTION = 'Write a git commit message for the current staging area and commit the changes.' Setup: 'git init' + 'echo 'print("hello world")' > hello.py' " 'git add hello.py' and verify results: 'git status'- 't05_simple_browsing.py` INSTRUCTION = 'Browse localhost:8000, and tell me the ultimate answer to life.' / HTML_FILE defined below. Setup: write HTML_FILE to tempfile.TemporaryDirectory + 'nohup python3 -m http.sever 8000 &'
- 't06_github_pr_browsing.py' INSTRUCTION = 'Look at Add MIT LICENSE OpenHands#8, and tell me what is happening there and what did @asadm suggest.'
- 't07_interactive_commands.py` INSTRUCTION = 'Execute the python script /workspace/python_script.py with input "John" and "25" and tell me the secret number.' Setup: SECRET_NUMBER = int(hashlib.sha256(str(25).encode()).hexdigest()[:8], 16) % 1000 / path='/workspace/python_script.py',
content=(
'name = input("Enter your name: "); age = input("Enter your age: "); '
'import hashlib; secret = int(hashlib.sha256(str(age).encode()).hexdigest()[:8], 16) % 1000; '
'print(f"Hello {name}, you are {age} years old. Tell you a secret number: {secret}")'
)
If you need to fetch data from the web you can use custom mcp tools such as examples/07_mcp_integration.py
HTML_FILE = """
<title>The Ultimate Answer</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: linear-gradient(to right, #1e3c72, #2a5298); color: #fff; font-family: 'Arial', sans-serif; text-align: center; } .container { text-align: center; padding: 20px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } h1 { font-size: 36px; margin-bottom: 20px; } p { font-size: 18px; margin-bottom: 30px; } #showButton { padding: 10px 20px; font-size: 16px; color: #1e3c72; background: #fff; border: none; border-radius: 5px; cursor: pointer; transition: background 0.3s ease; } #showButton:hover { background: #f0f0f0; } #result { margin-top: 20px; font-size: 24px; } </style>The Ultimate Answer
Click the button to reveal the answer to life, the universe, and everything.
Click meReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
openhandsSolving the issue with OpenHands.Solving the issue with OpenHands.