Put the release's tools on PATH of every claude the loop starts, and name them bare in the prose
CI / tests (pull_request) Successful in 4m36s
CI / tests (pull_request) Successful in 4m36s
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import pathlib
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from loop_state.paths import RELEASE_ROOT, with_release_tools
|
||||
|
||||
TOOLS = str(RELEASE_ROOT / "bin")
|
||||
|
||||
|
||||
class WithReleaseTools(unittest.TestCase):
|
||||
def test_puts_the_releases_tools_first_on_path_and_keeps_every_other_variable(self):
|
||||
self.assertEqual(with_release_tools({"PATH": "/usr/bin:/bin", "HOME": "/h"}), {"PATH": f"{TOOLS}:/usr/bin:/bin", "HOME": "/h"})
|
||||
|
||||
def test_leaves_a_path_that_already_opens_with_the_tools_as_it_is(self):
|
||||
self.assertEqual(with_release_tools({"PATH": f"{TOOLS}:/bin"}), {"PATH": f"{TOOLS}:/bin"})
|
||||
|
||||
def test_an_environment_without_a_path_gets_the_tools_alone(self):
|
||||
self.assertEqual(with_release_tools({}), {"PATH": TOOLS})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user