Skip to content

Commit d8926f2

Browse files
committed
repo env
1 parent 43d0d03 commit d8926f2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"froggy"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

froggy/tests/test_workspace.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
import pytest
1+
from unittest.mock import patch
2+
from froggy.envs import RepoEnv
3+
from froggy.utils import load_config
4+
from pathlib import PosixPath
25

6+
@patch('sys.argv', ['run.py', 'scripts/config.yaml', '--agent', 'cot', '--debug', '-v'])
37
def test_workspace():
4-
assert 2 + 2 == 4
8+
config, args = load_config()
9+
config = config[args.agent]
10+
11+
assert args.config_file == 'scripts/config.yaml'
12+
assert args.agent == 'cot'
13+
assert args.debug == True
14+
assert args.verbose == True
15+
16+
env = RepoEnv(**config["env_kwargs"])
17+
18+
assert isinstance(env.path, PosixPath)
19+
assert env.path == PosixPath('data/pytorch')
20+

0 commit comments

Comments
 (0)