Name the reload exit for what it checks, gate --help only on a typed task, drop the outlived todo caveat
This commit is contained in:
@@ -348,13 +348,10 @@ class Reload(unittest.TestCase):
|
||||
environment = dict(os.environ)
|
||||
with unittest.mock.patch.object(loop, "__file__", script), unittest.mock.patch("os.execv") as execv:
|
||||
loop.reload_if_edited("/r", "do it", cycle_number=1, failures=2)
|
||||
execv.assert_called_once_with(sys.executable, [sys.executable, script, loop.RELOAD_FLAG, STATE])
|
||||
execv.assert_called_once_with(sys.executable, [sys.executable, script, loop.RELOAD_FLAG, json.dumps({"cycle_number": 1, "failures": 2, "root": "/r", "task": "do it"})])
|
||||
self.assertEqual(dict(os.environ), environment)
|
||||
|
||||
|
||||
STATE = json.dumps({"cycle_number": 1, "failures": 2, "root": "/r", "task": "do it"})
|
||||
|
||||
|
||||
class Main(unittest.TestCase):
|
||||
def test_exits_naming_the_reload_when_it_hands_over_anything_but_the_state_with_a_task(self):
|
||||
for handed in (["3", "2", "/r", "do it"], ["3"], ["[1]"], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r"})], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r", "task": ""})]):
|
||||
|
||||
Reference in New Issue
Block a user