From a2caf6f4b22fe02feb0f23218ea05889ace29427 Mon Sep 17 00:00:00 2001 From: david-sarah Date: Fri, 18 Jun 2010 19:17:18 -0700 Subject: [PATCH] test_web.py: correct a test that was missed in the change to not write ctime/mtime. --- src/allmydata/test/test_web.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 -- 2.45.2