Impl --yes flag
This commit is contained in:
@@ -174,10 +174,10 @@ class UnmuxCliTests(unittest.TestCase):
|
||||
self.home_dir,
|
||||
self.database_path,
|
||||
"--subtitles-only",
|
||||
"--yes",
|
||||
"--label",
|
||||
"dball",
|
||||
str(source_path),
|
||||
input_text="y\n",
|
||||
)
|
||||
self.assertCompleted(completed)
|
||||
|
||||
|
||||
@@ -122,6 +122,20 @@ class UnmuxOutputDirectoryTests(unittest.TestCase):
|
||||
mocked_getchar.assert_called_once()
|
||||
mocked_confirm.assert_not_called()
|
||||
|
||||
def test_yes_creates_missing_output_directory_without_prompt(self):
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
output_directory = Path(tempdir) / "missing" / "parents" / "manual"
|
||||
|
||||
with patch("ffx.cli.click.confirm") as mocked_confirm:
|
||||
created = cli.ensureUnmuxOutputDirectory(
|
||||
{"dry_run": False, "yes": True},
|
||||
str(output_directory),
|
||||
)
|
||||
|
||||
self.assertTrue(created)
|
||||
self.assertTrue(output_directory.is_dir())
|
||||
mocked_confirm.assert_not_called()
|
||||
|
||||
def test_missing_output_directory_can_be_rejected(self):
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
output_directory = Path(tempdir) / "missing" / "manual"
|
||||
|
||||
Reference in New Issue
Block a user