Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix agentskills tests #2242

Merged
merged 11 commits into from
Jun 4, 2024
9 changes: 9 additions & 0 deletions tests/unit/test_agent_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@
)


# CURRENT_FILE must be reset for each test
@pytest.fixture(autouse=True)
def reset_current_file():
from opendevin.runtime.plugins.agent_skills import agentskills

agentskills.CURRENT_FILE = None


def test_open_file_unexist_path():
with pytest.raises(FileNotFoundError):
open_file('/unexist/path/a.txt')


def test_open_file(tmp_path):
assert tmp_path is not None
temp_file_path = tmp_path / 'a.txt'
temp_file_path.write_text('Line 1\nLine 2\nLine 3\nLine 4\nLine 5')

Expand Down