MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / test_bash_run

Function test_bash_run

scripts/monitoring/tests/test_utils_py.py:7–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_bash_run():
8 with patch("subprocess.run") as mock_subprocess_run:
9 # Test without sources
10 bash_run("echo 'Hello, World!'")
11 assert mock_subprocess_run.call_args[0][0] == [
12 "bash",
13 "-c",
14 "set -e\necho 'Hello, World!'",
15 ]
16
17 # Test with sources
18 mock_subprocess_run.reset_mock()
19 bash_run("echo 'Hello, World!'", sources=["source1.sh", "source2.sh"])
20 assert mock_subprocess_run.call_args[0][0] == [
21 "bash",
22 "-c",
23 'set -e\nsource "scripts/monitoring/source1.sh"\nsource "scripts/monitoring/source2.sh"\necho \'Hello, World!\'',
24 ]
25
26
27def test_limit_server():

Callers

nothing calls this directly

Calls 1

bash_runFunction · 0.90

Tested by

no test coverage detected