From: Brian Warner Date: Tue, 28 Aug 2007 00:26:39 +0000 (-0700) Subject: test_web: improve provisioning.py test coverage a bit by using a live web hit X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/reedownlee?a=commitdiff_plain;h=ed525f74780159c2432436a7625aeb938da6edc2;p=tahoe-lafs%2Ftahoe-lafs.git test_web: improve provisioning.py test coverage a bit by using a live web hit --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index e2356a49..d9e61384 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -319,7 +319,7 @@ class WebMixin(object): else: form.append('Content-Disposition: form-data; name="%s"' % name) form.append('') - form.append(value) + form.append(str(value)) form.append(sep) form[-1] += "--" body = "\r\n".join(form) + "\r\n" @@ -396,6 +396,32 @@ class Web(WebMixin, unittest.TestCase): d.addCallback(_check2) return d + def test_provisioning(self): + d = self.GET("/provisioning/") + def _check(res): + self.failUnless('Tahoe Provisioning Tool' in res) + fields = {'filled': True, + "num_users": int(50e3), + "files_per_user": 1000, + "space_per_user": int(1e9), + "sharing_ratio": 1.0, + "encoding_parameters": "3-of-10", + "num_servers": 30, + "ownership_mode": "A", + "download_rate": 100, + "upload_rate": 10, + "delete_rate": 10, + "lease_timer": 7, + } + return self.POST("/provisioning/", **fields) + + d.addCallback(_check) + def _check2(res): + self.failUnless('Tahoe Provisioning Tool' in res) + self.failUnless("Share space consumed: 167.01TB" in res) + d.addCallback(_check2) + return d + def test_start_html(self): fileutil.make_dirs("web") startfile = "web/start.html"