def test_run_scripts(self, tmpdir, debug, verbose, before, after, bootstrap): cider = Cider(False, debug, verbose, cider_dir=str(tmpdir)) cider.read_bootstrap = MagicMock(return_value=bootstrap) scripts = [] scripts += bootstrap.get("before-scripts", []) if before else [] scripts += bootstrap.get("after-scripts", []) if after else [] # TODO: Assert ordering with patch("cider.core.spawn", autospec=True, return_value=0) as spawn: cider.run_scripts(before, after) for script in scripts: spawn.assert_any_call( [script], shell=True, debug=debug, cwd=cider.cider_dir )
def test_run_scripts(self, tmpdir, debug, verbose, before, after, bootstrap): cider = Cider(False, debug, verbose, cider_dir=str(tmpdir)) cider.read_bootstrap = MagicMock(return_value=bootstrap) scripts = [] scripts += bootstrap.get("before-scripts", []) if before else [] scripts += bootstrap.get("after-scripts", []) if after else [] # TODO: Assert ordering with patch("cider.core.spawn", autospec=True, return_value=0) as spawn: cider.run_scripts(before, after) for script in scripts: spawn.assert_any_call([script], shell=True, debug=debug, cwd=cider.cider_dir, env=cider.env)