Browse Source

spell genident properly..

main
John-Mark Gurney 2 years ago
parent
commit
53c6d72103
2 changed files with 10 additions and 3 deletions
  1. +7
    -1
      ui/fixtures/cmd.basic.json
  2. +3
    -2
      ui/medashare/cli.py

+ 7
- 1
ui/fixtures/cmd.basic.json View File

@@ -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" ],


+ 3
- 2
ui/medashare/cli.py View File

@@ -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:


Loading…
Cancel
Save