mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 05:25:28 +08:00
[Project] Implementing Project CLI (#5397)
This commit is contained in:
@@ -16,7 +16,7 @@ TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
def load_project_description(project_file):
|
||||
path = os.path.join(TEST_DIR, "project_files", project_file)
|
||||
with open(path) as f:
|
||||
return yaml.load(f)
|
||||
return yaml.safe_load(f)
|
||||
|
||||
|
||||
def test_validation_success():
|
||||
@@ -58,4 +58,10 @@ def test_project_root():
|
||||
|
||||
def test_project_validation():
|
||||
path = os.path.join(TEST_DIR, "project_files", "project1")
|
||||
subprocess.check_call(["ray", "session", "create", "--dry"], cwd=path)
|
||||
subprocess.check_call(["ray", "project", "validate"], cwd=path)
|
||||
|
||||
|
||||
def test_project_no_validation():
|
||||
path = os.path.join(TEST_DIR, "project_files")
|
||||
with pytest.raises(subprocess.CalledProcessError):
|
||||
subprocess.check_call(["ray", "project", "validate"], cwd=path)
|
||||
|
||||
Reference in New Issue
Block a user