From c655651ec7983a6dc095b48070e8976f08dcc36e Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Fri, 8 Jan 2016 16:10:21 +1100 Subject: [PATCH] #6 - Use command genpkey instead of generate. --- phe/command_line.py | 4 ++-- phe/tests/cli_test.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phe/command_line.py b/phe/command_line.py index cdd2220..a8762f9 100755 --- a/phe/command_line.py +++ b/phe/command_line.py @@ -21,14 +21,14 @@ def cli(verbose=False): """CLI for interacting with python-paillier """ -@cli.command("generate") +@cli.command("genpkey") @click.argument('output', type=click.File('w')) @click.option("--keysize", type=int, default=2048, help="The keysize in bits. Defaults to 2048") @click.option("--id", type=str, default=None, help="Add an identifying comment to the key") def generate_keypair(keysize, id, output): - """Generate a paillier keypair + """Generate a paillier keypair. Output as JWK to given output file. Use "-" to output the private key to stdout. See the extract command to extract the public component of the diff --git a/phe/tests/cli_test.py b/phe/tests/cli_test.py index 895d3c6..d40a24c 100644 --- a/phe/tests/cli_test.py +++ b/phe/tests/cli_test.py @@ -27,7 +27,7 @@ def test_generate_keypair_to_file(self): runner = CliRunner() with tempfile.NamedTemporaryFile() as outfile: - result = runner.invoke(cli, ['generate', '--keysize', '256', outfile.name]) + result = runner.invoke(cli, ['genpkey', '--keysize', '256', outfile.name]) print(result.output) assert result.exit_code == 0 @@ -43,7 +43,7 @@ def test_generate_keypair_to_file(self): def test_generate_keypair_to_stdout(self): runner = CliRunner() - result = runner.invoke(cli, ['generate', '--keysize', '256', '-']) + result = runner.invoke(cli, ['genpkey', '--keysize', '256', '-']) assert 'pub' in result.output assert 'kty' in result.output @@ -53,7 +53,7 @@ def test_extract_public_key(self): runner = CliRunner() with tempfile.NamedTemporaryFile() as private_keyfile: - runner.invoke(cli, ['generate', '--keysize', '256', private_keyfile.name]) + runner.invoke(cli, ['genpkey', '--keysize', '256', private_keyfile.name]) with tempfile.NamedTemporaryFile() as public_keyfile: result = runner.invoke(cli, ['extract', private_keyfile.name, public_keyfile.name]) @@ -80,7 +80,7 @@ def setUpClass(cls): cls.public_keyfile = tempfile.NamedTemporaryFile() cls.runner = CliRunner() - cls.runner.invoke(cli, ['generate', '--keysize', '256', cls.private_keyfile.name]) + cls.runner.invoke(cli, ['genpkey', '--keysize', '256', cls.private_keyfile.name]) cls.runner.invoke(cli, ['extract', cls.private_keyfile.name, cls.public_keyfile.name]) @classmethod