mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 17:55:15 +08:00
[Projects] Add small tutorial for projects (#6641)
This commit is contained in:
@@ -9,7 +9,8 @@ from unittest.mock import patch, DEFAULT
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
from ray.projects.scripts import session_start, session_execute
|
||||
from ray.projects.scripts import (session_start, session_commands,
|
||||
session_execute)
|
||||
import ray
|
||||
|
||||
TEST_DIR = os.path.join(
|
||||
@@ -231,6 +232,17 @@ def test_session_create_multiple():
|
||||
assert result.exit_code == 1
|
||||
|
||||
|
||||
def test_session_commands():
|
||||
result, mock_calls, test_dir = run_test_project(
|
||||
"session-tests/commands-test", session_commands, [])
|
||||
|
||||
assert "This is the first parameter" in result.output
|
||||
assert "This is the second parameter" in result.output
|
||||
|
||||
assert 'Command "first"' in result.output
|
||||
assert 'Command "second"' in result.output
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Make subprocess happy in bazel.
|
||||
os.environ["LC_ALL"] = "en_US.UTF-8"
|
||||
|
||||
Reference in New Issue
Block a user