This commit is contained in:
@@ -79,6 +79,12 @@ class DoEpicTest(unittest.TestCase):
|
||||
self.issues = [issue("ABC-20", "repo:api")]
|
||||
return folder
|
||||
|
||||
def epic_run(self, fake: FakeEffects, env: dict[str, str] | None = None) -> main.EpicRun:
|
||||
config = main.load(self.home)
|
||||
assert not isinstance(config, Failure)
|
||||
store, record = self.backend(config, "ABC-12")
|
||||
return main.EpicRun("ABC-12", config, store, record, paths_from(self.home), env or {}, pathlib.Path("/b/do-epic"), fake.effects())
|
||||
|
||||
def run_main(self, argv: list[str], fake: FakeEffects, env: dict[str, str] | None = None) -> tuple[int, str, str]:
|
||||
out, err = io.StringIO(), io.StringIO()
|
||||
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
|
||||
@@ -146,13 +152,16 @@ class TheCommand(DoEpicTest):
|
||||
|
||||
|
||||
class ACycleOfAChunkWithoutARepo(DoEpicTest):
|
||||
def test_a_chunk_in_a_folder_no_project_config_names_stops_with_the_reason(self) -> None:
|
||||
stopped = main.chunk_work("ABC-21", str(self.home), "English", self.epic_run(FakeEffects()))
|
||||
assert isinstance(stopped, main.Stop)
|
||||
self.assertEqual(stopped.code, 1)
|
||||
self.assertIn("rev-parse", stopped.reason)
|
||||
|
||||
def cycle(self, env: dict[str, str] | None = None) -> main.Cycle:
|
||||
fake = FakeEffects(git=[Failure("no git"), Failure("no git")])
|
||||
paths = paths_from(self.home)
|
||||
config = main.load(self.home)
|
||||
assert not isinstance(config, Failure)
|
||||
store, record = self.backend(config, "ABC-12")
|
||||
epic = main.EpicRun("ABC-12", config, store, record, paths, env or {}, pathlib.Path("/b/do-epic"), fake.effects())
|
||||
epic = self.epic_run(fake, env)
|
||||
place = main.chunk_root("ABC-21", epic)
|
||||
assert isinstance(place, tuple)
|
||||
root, repo = place
|
||||
|
||||
Reference in New Issue
Block a user