mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 14:52:26 +00:00
parse capability properly instead of using string-compares
This commit is contained in:
parent
30100c8165
commit
2a39ae91a6
@ -6,6 +6,8 @@ import urllib2
|
|||||||
from os import mkdir, unlink, utime
|
from os import mkdir, unlink, utime
|
||||||
from os.path import join, exists, getmtime
|
from os.path import join, exists, getmtime
|
||||||
|
|
||||||
|
import allmydata.uri
|
||||||
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@ -64,8 +66,11 @@ def test_put(alice):
|
|||||||
u"file": FILE_CONTENTS,
|
u"file": FILE_CONTENTS,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
assert resp.text.strip().startswith("URI:CHK:")
|
cap = allmydata.uri.from_string(resp.text.strip().encode('ascii'))
|
||||||
assert resp.text.strip().endswith(":2:4:153")
|
assert isinstance(cap, allmydata.uri.CHKFileURI)
|
||||||
|
assert cap.size == 153
|
||||||
|
assert cap.total_shares == 4
|
||||||
|
assert cap.needed_shares == 2
|
||||||
|
|
||||||
|
|
||||||
def test_helper_status(storage_nodes):
|
def test_helper_status(storage_nodes):
|
||||||
|
Loading…
Reference in New Issue
Block a user