diff --git a/swift/cli/form_signature.py b/swift/cli/form_signature.py index 20452f36cd..0aefaca37d 100644 --- a/swift/cli/form_signature.py +++ b/swift/cli/form_signature.py @@ -46,6 +46,19 @@ def main(argv): print 'Example output:' print ' Expires: 1323842228' print ' Signature: 18de97e47345a82c4dbfb3b06a640dbb' + print + print 'Sample form:' + print + print('NOTE: the
tag\'s "action" attribute does not contain ' + 'the Swift cluster\'s hostname.') + print 'You should manually add it before using the form.' + print + print('') + print ' ' + print ' ... more HTML ...' + print ' ' + print '
' return 1 path, redirect, max_file_size, max_file_count, seconds, key = argv[1:] try: @@ -83,4 +96,32 @@ def main(argv): sha1).hexdigest() print ' Expires:', expires print 'Signature:', sig + print '' + + print('Sample form:\n') + + print('NOTE: the
tag\'s "action" attribute does not ' + 'contain the Swift cluster\'s hostname.') + print('You should manually add it before using the form.\n') + + print('' + % path) + if redirect: + print(' ' + % redirect) + print(' ' + % max_file_size) + print(' ' + % max_file_count) + print(' ' % expires) + print(' ' % sig) + print(' ' + % max_file_count) + print(' ') + print(' ') + for i in range(max_file_count): + print(' ' % i) + print('
') + print(' ') + print('
') return 0 diff --git a/test/unit/cli/test_form_signature.py b/test/unit/cli/test_form_signature.py index fa2c9da90c..3120f08cda 100644 --- a/test/unit/cli/test_form_signature.py +++ b/test/unit/cli/test_form_signature.py @@ -54,6 +54,10 @@ class TestFormSignature(unittest.TestCase): self.assertTrue("Expires: %d" % (the_time + expires,) in out.getvalue()) + sig_input = ('' + % expected_signature) + self.assertTrue(sig_input in out.getvalue()) + def test_too_few_args(self): out = StringIO() with mock.patch('sys.stdout', out):