Ship the do-epic launcher, keep its transcripts out of the repo and in the backup list
This commit is contained in:
@@ -2,6 +2,7 @@ import contextlib
|
||||
import dataclasses
|
||||
import io
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -58,6 +59,15 @@ class DoEpicTest(unittest.TestCase):
|
||||
return code, out.getvalue(), err.getvalue()
|
||||
|
||||
|
||||
class TheLauncher(unittest.TestCase):
|
||||
def test_the_repo_ships_a_do_epic_that_prints_its_help(self) -> None:
|
||||
launcher = pathlib.Path(__file__).resolve().parents[1] / "do-epic"
|
||||
ran = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=60)
|
||||
self.assertEqual((ran.returncode, ran.stdout.split(" ", 2)[2]), (0, main.HELP + "\n"))
|
||||
tracked = subprocess.run(["git", "ls-files", "--error-unmatch", launcher.name], capture_output=True, cwd=launcher.parent)
|
||||
self.assertEqual(tracked.returncode, 0, "bin/do-epic is not in the repo; .gitignore lists what it keeps")
|
||||
|
||||
|
||||
class TheCommand(DoEpicTest):
|
||||
def test_prints_the_help_for_anything_but_one_epic_key(self) -> None:
|
||||
for argv, code in ((["--help"], 0), (["-h"], 0), ([], 1), (["abc"], 1), (["ABC-12", "ABC-13"], 1), (["--chunk", "x", "ABC-12"], 1), (["--chunk", "ABC-12"], 1)):
|
||||
|
||||
Reference in New Issue
Block a user