From: david-sarah Date: Sat, 19 Jun 2010 02:17:18 +0000 (-0700) Subject: test_web.py: correct a test that was missed in the change to not write ctime/mtime. X-Git-Tag: allmydata-tahoe-1.7.0~10 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/%22file:/status?a=commitdiff_plain;h=a2caf6f4b22fe02feb0f23218ea05889ace29427;p=tahoe-lafs%2Ftahoe-lafs.git test_web.py: correct a test that was missed in the change to not write ctime/mtime. --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index fe615f5d..c67e81cc 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -250,6 +250,8 @@ class WebMixin(object): self.failUnlessEqual(kids[u"bar.txt"][1]["ro_uri"], self._bar_txt_uri) self.failUnlessEqual(kids[u"bar.txt"][1]["verify_uri"], self._bar_txt_verifycap) + self.failUnlessIn("metadata", kids[u"bar.txt"][1]) + self.failUnlessIn("tahoe", kids[u"bar.txt"][1]["metadata"]) self.failUnlessEqual(kids[u"bar.txt"][1]["metadata"]["tahoe"]["linkcrtime"], self._bar_txt_metadata["tahoe"]["linkcrtime"]) self.failUnlessEqual(kids[u"n\u00fc.txt"][1]["ro_uri"], @@ -933,11 +935,12 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): def failUnlessHasBarDotTxtMetadata(self, res): data = simplejson.loads(res) self.failUnless(isinstance(data, list)) - self.failUnless(data[1].has_key("metadata")) - self.failUnless(data[1]["metadata"].has_key("ctime")) - self.failUnless(data[1]["metadata"].has_key("mtime")) - self.failUnlessEqual(data[1]["metadata"]["ctime"], - self._bar_txt_metadata["ctime"]) + self.failUnlessIn("metadata", data[1]) + self.failUnlessIn("tahoe", data[1]["metadata"]) + self.failUnlessIn("linkcrtime", data[1]["metadata"]["tahoe"]) + self.failUnlessIn("linkmotime", data[1]["metadata"]["tahoe"]) + self.failUnlessEqual(data[1]["metadata"]["tahoe"]["linkcrtime"], + self._bar_txt_metadata["tahoe"]["linkcrtime"]) def test_GET_FILEURL_json(self): # twisted.web.http.parse_qs ignores any query args without an '=', so