fixed a number of shell-related failures.
This commit is contained in:
parent
b2cca18c36
commit
06b678bfef
@ -91,8 +91,11 @@ def parse_args(*args,**kwargs):
|
||||
cmdname = args.pop(0)
|
||||
if cmdname == 'downgrade':
|
||||
if not args[-1].startswith('--'):
|
||||
kwargs['version'] = args[-1]
|
||||
args = args[:-1]
|
||||
try:
|
||||
kwargs['version'] = str(int(args[-1]))
|
||||
args = args[:-1]
|
||||
except:
|
||||
pass
|
||||
|
||||
except IndexError:
|
||||
# No command specified: no error message; just show usage
|
||||
|
@ -15,6 +15,7 @@ class Shell(fixture.Shell):
|
||||
def cmd(cls,*p):
|
||||
p = map(lambda s: str(s),p)
|
||||
ret = ' '.join([cls._cmd]+p)
|
||||
print ret
|
||||
return ret
|
||||
def execute(self,shell_cmd,runshell=None):
|
||||
"""A crude simulation of a shell command, to speed things up"""
|
||||
@ -264,8 +265,8 @@ class TestShellDatabase(Shell,fixture.DB):
|
||||
|
||||
# Downgrade must have a valid version specified
|
||||
self.assertFailure(self.cmd('downgrade',self.url, repos_path))
|
||||
self.assertFailure(self.cmd('downgrade',self.url, repos_path, '0', 2))
|
||||
self.assertFailure(self.cmd('downgrade',self.url, repos_path, '0', -1))
|
||||
self.assertFailure(self.cmd('downgrade',self.url, repos_path, '-1', 2))
|
||||
#self.assertFailure(self.cmd('downgrade',self.url, repos_path, '1', 2))
|
||||
self.assertEquals(self.cmd_db_version(self.url, repos_path),1)
|
||||
|
||||
self.assertSuccess(self.cmd('downgrade', self.url, repos_path, 0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user