diff --git a/ui/fixtures/cmd.basic.json b/ui/fixtures/cmd.basic.json index 3216fd5..789c753 100644 --- a/ui/fixtures/cmd.basic.json +++ b/ui/fixtures/cmd.basic.json @@ -3,13 +3,19 @@ "title": "Test no ident", "cmd": [ "list", "afile" ], "exit": 1, - "stderr": "ERROR: Identity not created, create w/ -g.\n" + "stderr": "ERROR: Identity not created, create w/ genident.\n" }, { "title": "gen ident", "cmd": [ "genident", "name=A Test User" ], "exit": 0 }, +{ + "title": "gen ident", + "cmd": [ "genident", "name=A Test User" ], + "exit": 1, + "stderr": "Error: Identity already created.\n" +}, { "title": "print ident", "cmd": [ "ident" ], diff --git a/ui/medashare/cli.py b/ui/medashare/cli.py index a640f67..75d37ed 100644 --- a/ui/medashare/cli.py +++ b/ui/medashare/cli.py @@ -609,7 +609,7 @@ def get_persona(options): try: persona = Persona.load(identfname) except FileNotFoundError: - print('ERROR: Identity not created, create w/ -g.', + print('ERROR: Identity not created, create w/ genident.', file=sys.stderr) sys.exit(1) @@ -1246,6 +1246,7 @@ class _TestCases(unittest.TestCase): os.chdir(self.tempdir) self.run_command_file(i) + # XXX - the following test may no longer be needed def test_main(self): # Test the main runner, this is only testing things that are # specific to running the program, like where the store is @@ -1286,7 +1287,7 @@ class _TestCases(unittest.TestCase): # with the correct error message self.assertEqual(stderr.getvalue(), - 'ERROR: Identity not created, create w/ -g.\n') + 'ERROR: Identity not created, create w/ genident.\n') with mock.patch('os.path.expanduser', side_effect=expandusermock) \ as eu: