Closer to passing tests.
This commit is contained in:
parent
d8c9affccb
commit
565c48045e
|
@ -203,7 +203,7 @@ class CHKUploadHelper(Referenceable, upload.CHKUploader):
|
|||
def _finished(self, ur):
|
||||
assert interfaces.IUploadResults.providedBy(ur), ur
|
||||
vcapstr = ur.get_verifycapstr()
|
||||
precondition(isinstance(vcapstr, str), vcapstr)
|
||||
precondition(isinstance(vcapstr, bytes), vcapstr)
|
||||
v = uri.from_string(vcapstr)
|
||||
f_times = self._fetcher.get_times()
|
||||
|
||||
|
@ -492,9 +492,9 @@ class Helper(Referenceable):
|
|||
# helper at random.
|
||||
|
||||
name = "helper"
|
||||
VERSION = { "http://allmydata.org/tahoe/protocols/helper/v1" :
|
||||
VERSION = { b"http://allmydata.org/tahoe/protocols/helper/v1" :
|
||||
{ },
|
||||
"application-version": str(allmydata.__full_version__),
|
||||
b"application-version": allmydata.__full_version__.encode("utf-8"),
|
||||
}
|
||||
MAX_UPLOAD_STATUSES = 10
|
||||
|
||||
|
|
|
@ -1816,15 +1816,15 @@ class Uploader(service.MultiService, log.PrefixingLogMixin):
|
|||
|
||||
def _got_helper(self, helper):
|
||||
self.log("got helper connection, getting versions")
|
||||
default = { "http://allmydata.org/tahoe/protocols/helper/v1" :
|
||||
default = { b"http://allmydata.org/tahoe/protocols/helper/v1" :
|
||||
{ },
|
||||
"application-version": b"unknown: no get_version()",
|
||||
b"application-version": b"unknown: no get_version()",
|
||||
}
|
||||
d = add_version_to_remote_reference(helper, default)
|
||||
d.addCallback(self._got_versioned_helper)
|
||||
|
||||
def _got_versioned_helper(self, helper):
|
||||
needed = "http://allmydata.org/tahoe/protocols/helper/v1"
|
||||
needed = b"http://allmydata.org/tahoe/protocols/helper/v1"
|
||||
if needed not in helper.version:
|
||||
raise InsufficientVersionError(needed, helper.version)
|
||||
self._helper = helper
|
||||
|
|
|
@ -218,7 +218,7 @@ class AssistedUpload(unittest.TestCase):
|
|||
d.addCallback(_ready)
|
||||
def _uploaded(results):
|
||||
the_uri = results.get_uri()
|
||||
assert "CHK" in the_uri
|
||||
assert b"CHK" in the_uri
|
||||
d.addCallback(_uploaded)
|
||||
|
||||
def _check_empty(res):
|
||||
|
|
Loading…
Reference in New Issue