def __init__(self, baseurl, uri):
self.burl = baseurl
self.uri = uri
- self.fullurl = '%s/uri/%s' % (self.burl, self.uri.replace('/', '!'))
+ self.fullurl = '%s/uri/%s' % (self.burl, self.uri)
self.inode = TahoeNode.NextInode
TahoeNode.NextInode += 1
def _test_web(self, res):
base = self.webish_url
- public = "uri/" + self._root_directory_uri.replace("/", "!")
+ public = "uri/" + self._root_directory_uri
d = getPage(base)
def _got_welcome(page):
expected = "Connected Peers: <span>%d</span>" % (self.numclients)
self.failUnless(self.webish_url in start_html)
d = self.clients[0].get_private_uri()
def done(private_uri):
- private_url = self.webish_url + "uri/" + private_uri.replace("/","!")
+ private_url = self.webish_url + "uri/" + private_uri
self.failUnless(private_url in start_html)
d.addCallback(done)
return d
return res
def test_GET_URI_URL(self):
- base = "/uri/%s" % self._bar_txt_uri.replace("/","!")
+ base = "/uri/%s" % self._bar_txt_uri
d = self.GET(base)
d.addCallback(self.failUnlessIsBarDotTxt)
d.addCallback(lambda res: self.GET(base+"?filename=bar.txt"))
return d
def test_GET_URI_URL_dir(self):
- base = "/uri/%s?t=json" % self._foo_uri.replace("/","!")
+ base = "/uri/%s?t=json" % self._foo_uri
d = self.GET(base)
d.addCallback(self.failUnlessIsFooJSON)
return d
def test_GET_URI_URL_missing(self):
- base = "/uri/%s" % self._bad_file_uri.replace("/","!")
+ base = "/uri/%s" % self._bad_file_uri
d = self.GET(base)
d.addBoth(self.shouldHTTPError, "test_GET_URI_URL_missing",
http.GONE, response_substring="NotEnoughPeersError")
self.failUnless(uri in FakeCHKFileNode.all_contents)
self.failUnlessEqual(FakeCHKFileNode.all_contents[uri],
file_contents)
- return self.GET("/uri/%s" % uri.replace("/","!"))
+ return self.GET("/uri/%s" % uri)
d.addCallback(_check)
def _check2(res):
self.failUnlessEqual(res, file_contents)
n = self.s.create_node_from_uri(uri.strip())
d2 = self.failUnlessNodeKeysAre(n, [])
d2.addCallback(lambda res:
- self.GET("/uri/%s?t=json" % uri.replace("/","!")))
+ self.GET("/uri/%s?t=json" % uri))
return d2
d.addCallback(_check)
d.addCallback(self.failUnlessIsEmptyJSON)