Merge pull request #544 from tahoe-lafs/2967.alias-test_create

Fix CreateAlias.test_create

This test didn't previously run completely due to a bug in the test itself.

Fixes: ticket:2967
This commit is contained in:
Jean-Paul Calderone 2019-01-31 08:16:39 -05:00 committed by GitHub
commit baa0a46cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

1
newsfragments/2967.other Normal file
View File

@ -0,0 +1 @@
A bug in the test suite for the create-alias command has been fixed.

View File

@ -1,3 +1,4 @@
from StringIO import StringIO
import os.path
from twisted.trial import unittest
import urllib
@ -17,7 +18,10 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase):
o.parseOptions(["--node-directory", self.get_clientdir(), "webopen"]
+ list(args))
urls = []
rc = cli.webopen(o, urls.append)
o.subOptions.stdout = StringIO()
o.subOptions.stderr = StringIO()
o.subOptions.stdin = StringIO()
rc = cli.webopen(o.subOptions, urls.append)
self.failUnlessReallyEqual(rc, 0)
self.failUnlessReallyEqual(len(urls), 1)
self.failUnlessReallyEqual(urls[0], expected_url)
@ -145,6 +149,7 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase):
self.failUnless("un-corrupted2" in aliases)
self.failUnless(aliases["un-corrupted2"].startswith("URI:DIR2:"))
d.addCallback(_check_not_corrupted)
return d
def test_create_unicode(self):
self.basedir = "cli/CreateAlias/create_unicode"
@ -205,5 +210,3 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase):
return d
# TODO: test list-aliases, including Unicode