From 3532bcca9776fd4f7051d8dbd59c74be9574620a Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 1 Aug 2021 14:31:06 -0700 Subject: [PATCH] Test for --drop error without --output or --multi --- tests/test_cli_convert.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_cli_convert.py b/tests/test_cli_convert.py index 1bb6c4f..d3f5d28 100644 --- a/tests/test_cli_convert.py +++ b/tests/test_cli_convert.py @@ -403,3 +403,10 @@ def test_recipe_jsonsplit_output(fresh_db_and_path, drop): if drop: del expected["records"] assert db["example"].get(1) == expected + + +def test_cannot_use_drop_without_multi_or_output(fresh_db_and_path): + args = ["convert", fresh_db_and_path[1], "example", "records", "value", "--drop"] + result = CliRunner().invoke(cli.cli, args) + assert result.exit_code == 1, result.output + assert "Error: --drop can only be used with --output or --multi" in result.output