Answer stability round 1: 0 🔴, 3 🟡 (0 misread); drop the duplicate predicate test, say that finds_this_docker assumes run-heavy's PATH, say why resets_path matches broadly
This commit is contained in:
@@ -9,7 +9,6 @@ import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from run_heavy.capped_docker import finds_this_docker
|
||||
from run_heavy import main
|
||||
from machine_load.memory import read_memory
|
||||
from machine_load.slots import slot_count, usable_cpus
|
||||
@@ -142,14 +141,6 @@ class RunHeavy(unittest.TestCase):
|
||||
self.assertEqual(helped.returncode, 0)
|
||||
self.assertIn("usage: run-heavy <command>", helped.stdout)
|
||||
|
||||
def test_the_capped_docker_is_found_only_by_docker_named_bare_with_no_word_before_it_resetting_path(self):
|
||||
for word, before in [("docker", []), ("docker", ["run-heavy"]), ("docker", ["run-heavy", "env", "X=1"]), ("docker", ["run-heavy", "nice", "-n", "19"])]:
|
||||
with self.subTest(word=word, before=before):
|
||||
self.assertTrue(finds_this_docker(word, before))
|
||||
for word, before in [("/usr/bin/docker", []), ("docker", ["env", "PATH=/usr/bin"]), ("docker", ["env", "-i"]), ("docker", ["env", "-u", "PATH"]), ("docker", ["env", "--unset=PATH"]), ("docker", ["sudo"]), ("docker", ["/usr/bin/doas"])]:
|
||||
with self.subTest(word=word, before=before):
|
||||
self.assertFalse(finds_this_docker(word, before))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user