Sun Jul 11 21:02:52 GMT Daylight Time 2010 david-sarah@jacaranda.org * Add tests of caps from the future that have non-ASCII characters in them (encoded as UTF-8). The changes to test_uri.py, test_client.py, and test_dirnode.py add tests of non-ASCII future caps in addition to the current tests. The changes to test_web.py just replace the tests of all-ASCII future caps with tests of non-ASCII future caps. We also change uses of failUnlessEqual to failUnlessReallyEqual, in order to catch cases where the type of a string is not as expected. New patches: [Add tests of caps from the future that have non-ASCII characters in them (encoded as UTF-8). The changes to test_uri.py, test_client.py, and test_dirnode.py add tests of non-ASCII future caps in addition to the current tests. The changes to test_web.py just replace the tests of all-ASCII future caps with tests of non-ASCII future caps. We also change uses of failUnlessEqual to failUnlessReallyEqual, in order to catch cases where the type of a string is not as expected. david-sarah@jacaranda.org**20100711200252 Ignore-this: c2f193352369d32e06865f8f3e951894 ] { hunk ./src/allmydata/test/test_client.py 30 "introducer.furl = \n" ) -class Basic(unittest.TestCase): +class Basic(testutil.ReallyEqualMixin, unittest.TestCase): def test_loadable(self): basedir = "test_client.Basic.test_loadable" os.mkdir(basedir) hunk ./src/allmydata/test/test_client.py 84 f.write("reserved_space = 1000\n") f.close() c = client.Client(basedir) - self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 1000) + self.failUnlessReallyEqual(c.getServiceNamed("storage").reserved_space, 1000) def test_reserved_2(self): basedir = "client.Basic.test_reserved_2" hunk ./src/allmydata/test/test_client.py 96 f.write("reserved_space = 10K\n") f.close() c = client.Client(basedir) - self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 10*1000) + self.failUnlessReallyEqual(c.getServiceNamed("storage").reserved_space, 10*1000) def test_reserved_3(self): basedir = "client.Basic.test_reserved_3" hunk ./src/allmydata/test/test_client.py 108 f.write("reserved_space = 5mB\n") f.close() c = client.Client(basedir) - self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, + self.failUnlessReallyEqual(c.getServiceNamed("storage").reserved_space, 5*1000*1000) def test_reserved_4(self): hunk ./src/allmydata/test/test_client.py 121 f.write("reserved_space = 78Gb\n") f.close() c = client.Client(basedir) - self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, - 78*1000*1000*1000) + self.failUnlessReallyEqual(c.getServiceNamed("storage").reserved_space, + 78*1000*1000*1000) def test_reserved_bad(self): basedir = "client.Basic.test_reserved_bad" hunk ./src/allmydata/test/test_client.py 134 f.write("reserved_space = bogus\n") f.close() c = client.Client(basedir) - self.failUnlessEqual(c.getServiceNamed("storage").reserved_space, 0) + self.failUnlessReallyEqual(c.getServiceNamed("storage").reserved_space, 0) def _permute(self, sb, key): return [ peerid hunk ./src/allmydata/test/test_client.py 145 for k in ["%d" % i for i in range(5)]: sb.test_add_server(k, None) - self.failUnlessEqual(self._permute(sb, "one"), ['3','1','0','4','2']) - self.failUnlessEqual(self._permute(sb, "two"), ['0','4','2','1','3']) + self.failUnlessReallyEqual(self._permute(sb, "one"), ['3','1','0','4','2']) + self.failUnlessReallyEqual(self._permute(sb, "two"), ['0','4','2','1','3']) sb.test_servers.clear() hunk ./src/allmydata/test/test_client.py 148 - self.failUnlessEqual(self._permute(sb, "one"), []) + self.failUnlessReallyEqual(self._permute(sb, "one"), []) def test_versions(self): basedir = "test_client.Basic.test_versions" hunk ./src/allmydata/test/test_client.py 157 c = client.Client(basedir) ss = c.getServiceNamed("storage") verdict = ss.remote_get_version() - self.failUnlessEqual(verdict["application-version"], - str(allmydata.__full_version__)) + self.failUnlessReallyEqual(verdict["application-version"], + str(allmydata.__full_version__)) self.failIfEqual(str(allmydata.__version__), "unknown") self.failUnless("." in str(allmydata.__full_version__), "non-numeric version in '%s'" % allmydata.__version__) hunk ./src/allmydata/test/test_client.py 228 d.addCallback(_restart) return d -class NodeMaker(unittest.TestCase): +class NodeMaker(testutil.ReallyEqualMixin, unittest.TestCase): def test_maker(self): basedir = "client/NodeMaker/maker" fileutil.make_dirs(basedir) hunk ./src/allmydata/test/test_client.py 300 self.failIf(IMutableFileNode.providedBy(n)) self.failIf(IDirectoryNode.providedBy(n)) self.failUnless(n.is_unknown()) - self.failUnlessEqual(n.get_uri(), unknown_rw) - self.failUnlessEqual(n.get_write_uri(), unknown_rw) - self.failUnlessEqual(n.get_readonly_uri(), "ro." + unknown_ro) + self.failUnlessReallyEqual(n.get_uri(), unknown_rw) + self.failUnlessReallyEqual(n.get_write_uri(), unknown_rw) + self.failUnlessReallyEqual(n.get_readonly_uri(), "ro." + unknown_ro) + + unknown_rw = u"lafs://from_the_future_rw_\u263A".encode('utf-8') + unknown_ro = u"lafs://readonly_from_the_future_ro_\u263A".encode('utf-8') + n = c.create_node_from_uri(unknown_rw, unknown_ro) + self.failUnless(IFilesystemNode.providedBy(n)) + self.failIf(IFileNode.providedBy(n)) + self.failIf(IImmutableFileNode.providedBy(n)) + self.failIf(IMutableFileNode.providedBy(n)) + self.failIf(IDirectoryNode.providedBy(n)) + self.failUnless(n.is_unknown()) + self.failUnlessReallyEqual(n.get_uri(), unknown_rw) + self.failUnlessReallyEqual(n.get_write_uri(), unknown_rw) + self.failUnlessReallyEqual(n.get_readonly_uri(), "ro." + unknown_ro) hunk ./src/allmydata/test/test_dirnode.py 49 mut_read_uri = "URI:SSK-RO:jf6wkflosyvntwxqcdo7a54jvm:euw4iw7bbnkrrwpzuburbhppuxhc3gwxv26f6imekhz7zyw2ojnq" future_write_uri = "x-tahoe-crazy://I_am_from_the_future." future_read_uri = "x-tahoe-crazy-readonly://I_am_from_the_future." +future_nonascii_write_uri = u"x-tahoe-even-more-crazy://I_am_from_the_future_rw_\u263A".encode('utf-8') +future_nonascii_read_uri = u"x-tahoe-even-more-crazy-readonly://I_am_from_the_future_ro_\u263A".encode('utf-8') # 'o' 'n' 'e-macron' one_nfc = u"on\u0113" hunk ./src/allmydata/test/test_dirnode.py 57 one_nfd = u"one\u0304" class Dirnode(GridTestMixin, unittest.TestCase, - testutil.ShouldFailMixin, testutil.StallMixin, ErrorMixin): + testutil.ReallyEqualMixin, testutil.ShouldFailMixin, testutil.StallMixin, ErrorMixin): timeout = 240 # It takes longer than 120 seconds on Francois's arm box. def test_basic(self): hunk ./src/allmydata/test/test_dirnode.py 89 u"mut": (nm.create_from_cap(mut_write_uri, mut_read_uri), {}), u"fut": (nm.create_from_cap(future_write_uri, future_read_uri), {}), u"fro": (nm.create_from_cap(None, future_read_uri), {}), + u"fut-unic": (nm.create_from_cap(future_nonascii_write_uri, future_nonascii_read_uri), {}), + u"fro-unic": (nm.create_from_cap(None, future_nonascii_read_uri), {}), u"empty_litdir": (nm.create_from_cap(empty_litdir_uri), {}), u"tiny_litdir": (nm.create_from_cap(tiny_litdir_uri), {}), } hunk ./src/allmydata/test/test_dirnode.py 109 d.addCallback(_created) def _check_kids(children): - self.failUnlessEqual(set(children.keys()), - set([one_nfc, u"two", u"mut", u"fut", u"fro", u"empty_litdir", u"tiny_litdir"])) + self.failUnlessReallyEqual(set(children.keys()), + set([one_nfc, u"two", u"mut", u"fut", u"fro", + u"fut-unic", u"fro-unic", u"empty_litdir", u"tiny_litdir"])) one_node, one_metadata = children[one_nfc] two_node, two_metadata = children[u"two"] mut_node, mut_metadata = children[u"mut"] hunk ./src/allmydata/test/test_dirnode.py 117 fut_node, fut_metadata = children[u"fut"] fro_node, fro_metadata = children[u"fro"] + futna_node, futna_metadata = children[u"fut-unic"] + frona_node, frona_metadata = children[u"fro-unic"] emptylit_node, emptylit_metadata = children[u"empty_litdir"] tinylit_node, tinylit_metadata = children[u"tiny_litdir"] hunk ./src/allmydata/test/test_dirnode.py 122 - self.failUnlessEqual(one_node.get_size(), 3) - self.failUnlessEqual(one_node.get_uri(), one_uri) - self.failUnlessEqual(one_node.get_readonly_uri(), one_uri) + self.failUnlessReallyEqual(one_node.get_size(), 3) + self.failUnlessReallyEqual(one_node.get_uri(), one_uri) + self.failUnlessReallyEqual(one_node.get_readonly_uri(), one_uri) self.failUnless(isinstance(one_metadata, dict), one_metadata) hunk ./src/allmydata/test/test_dirnode.py 127 - self.failUnlessEqual(two_node.get_size(), 14861) - self.failUnlessEqual(two_node.get_uri(), setup_py_uri) - self.failUnlessEqual(two_node.get_readonly_uri(), setup_py_uri) - self.failUnlessEqual(two_metadata["metakey"], "metavalue") + self.failUnlessReallyEqual(two_node.get_size(), 14861) + self.failUnlessReallyEqual(two_node.get_uri(), setup_py_uri) + self.failUnlessReallyEqual(two_node.get_readonly_uri(), setup_py_uri) + self.failUnlessReallyEqual(two_metadata["metakey"], "metavalue") hunk ./src/allmydata/test/test_dirnode.py 132 - self.failUnlessEqual(mut_node.get_uri(), mut_write_uri) - self.failUnlessEqual(mut_node.get_readonly_uri(), mut_read_uri) + self.failUnlessReallyEqual(mut_node.get_uri(), mut_write_uri) + self.failUnlessReallyEqual(mut_node.get_readonly_uri(), mut_read_uri) self.failUnless(isinstance(mut_metadata, dict), mut_metadata) self.failUnless(fut_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 137 - self.failUnlessEqual(fut_node.get_uri(), future_write_uri) - self.failUnlessEqual(fut_node.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fut_node.get_uri(), future_write_uri) + self.failUnlessReallyEqual(fut_node.get_readonly_uri(), "ro." + future_read_uri) self.failUnless(isinstance(fut_metadata, dict), fut_metadata) hunk ./src/allmydata/test/test_dirnode.py 140 - + + self.failUnless(futna_node.is_unknown()) + self.failUnlessReallyEqual(futna_node.get_uri(), future_nonascii_write_uri) + self.failUnlessReallyEqual(futna_node.get_readonly_uri(), "ro." + future_nonascii_read_uri) + self.failUnless(isinstance(futna_metadata, dict), futna_metadata) + self.failUnless(fro_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 147 - self.failUnlessEqual(fro_node.get_uri(), "ro." + future_read_uri) - self.failUnlessEqual(fut_node.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fro_node.get_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fut_node.get_readonly_uri(), "ro." + future_read_uri) self.failUnless(isinstance(fro_metadata, dict), fro_metadata) hunk ./src/allmydata/test/test_dirnode.py 151 + self.failUnless(frona_node.is_unknown()) + self.failUnlessReallyEqual(frona_node.get_uri(), "ro." + future_nonascii_read_uri) + self.failUnlessReallyEqual(futna_node.get_readonly_uri(), "ro." + future_nonascii_read_uri) + self.failUnless(isinstance(frona_metadata, dict), frona_metadata) + self.failIf(emptylit_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 157 - self.failUnlessEqual(emptylit_node.get_storage_index(), None) + self.failUnlessReallyEqual(emptylit_node.get_storage_index(), None) self.failIf(tinylit_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 159 - self.failUnlessEqual(tinylit_node.get_storage_index(), None) + self.failUnlessReallyEqual(tinylit_node.get_storage_index(), None) d2 = defer.succeed(None) d2.addCallback(lambda ignored: emptylit_node.list()) hunk ./src/allmydata/test/test_dirnode.py 165 d2.addCallback(lambda children: self.failUnlessEqual(children, {})) d2.addCallback(lambda ignored: tinylit_node.list()) - d2.addCallback(lambda children: self.failUnlessEqual(set(children.keys()), - set([u"short"]))) + d2.addCallback(lambda children: self.failUnlessReallyEqual(set(children.keys()), + set([u"short"]))) d2.addCallback(lambda ignored: tinylit_node.list()) d2.addCallback(lambda children: children[u"short"][0].read(MemAccum())) hunk ./src/allmydata/test/test_dirnode.py 169 - d2.addCallback(lambda accum: self.failUnlessEqual(accum.data, "The end.")) + d2.addCallback(lambda accum: self.failUnlessReallyEqual(accum.data, "The end.")) return d2 d.addCallback(_check_kids) hunk ./src/allmydata/test/test_dirnode.py 205 u"two": (nm.create_from_cap(setup_py_uri), {"metakey": "metavalue"}), u"fut": (nm.create_from_cap(None, future_read_uri), {}), + u"futna": (nm.create_from_cap(None, future_nonascii_read_uri), {}), u"empty_litdir": (nm.create_from_cap(empty_litdir_uri), {}), u"tiny_litdir": (nm.create_from_cap(tiny_litdir_uri), {}), } hunk ./src/allmydata/test/test_dirnode.py 227 d.addCallback(_created) def _check_kids(children): - self.failUnlessEqual(set(children.keys()), - set([one_nfc, u"two", u"fut", u"empty_litdir", u"tiny_litdir"])) + self.failUnlessReallyEqual(set(children.keys()), + set([one_nfc, u"two", u"fut", u"futna", u"empty_litdir", u"tiny_litdir"])) one_node, one_metadata = children[one_nfc] two_node, two_metadata = children[u"two"] fut_node, fut_metadata = children[u"fut"] hunk ./src/allmydata/test/test_dirnode.py 232 + futna_node, futna_metadata = children[u"futna"] emptylit_node, emptylit_metadata = children[u"empty_litdir"] tinylit_node, tinylit_metadata = children[u"tiny_litdir"] hunk ./src/allmydata/test/test_dirnode.py 236 - self.failUnlessEqual(one_node.get_size(), 3) - self.failUnlessEqual(one_node.get_uri(), one_uri) - self.failUnlessEqual(one_node.get_readonly_uri(), one_uri) + self.failUnlessReallyEqual(one_node.get_size(), 3) + self.failUnlessReallyEqual(one_node.get_uri(), one_uri) + self.failUnlessReallyEqual(one_node.get_readonly_uri(), one_uri) self.failUnless(isinstance(one_metadata, dict), one_metadata) hunk ./src/allmydata/test/test_dirnode.py 241 - self.failUnlessEqual(two_node.get_size(), 14861) - self.failUnlessEqual(two_node.get_uri(), setup_py_uri) - self.failUnlessEqual(two_node.get_readonly_uri(), setup_py_uri) - self.failUnlessEqual(two_metadata["metakey"], "metavalue") + self.failUnlessReallyEqual(two_node.get_size(), 14861) + self.failUnlessReallyEqual(two_node.get_uri(), setup_py_uri) + self.failUnlessReallyEqual(two_node.get_readonly_uri(), setup_py_uri) + self.failUnlessReallyEqual(two_metadata["metakey"], "metavalue") self.failUnless(fut_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 247 - self.failUnlessEqual(fut_node.get_uri(), "imm." + future_read_uri) - self.failUnlessEqual(fut_node.get_readonly_uri(), "imm." + future_read_uri) + self.failUnlessReallyEqual(fut_node.get_uri(), "imm." + future_read_uri) + self.failUnlessReallyEqual(fut_node.get_readonly_uri(), "imm." + future_read_uri) self.failUnless(isinstance(fut_metadata, dict), fut_metadata) hunk ./src/allmydata/test/test_dirnode.py 251 + self.failUnless(futna_node.is_unknown()) + self.failUnlessReallyEqual(futna_node.get_uri(), "imm." + future_nonascii_read_uri) + self.failUnlessReallyEqual(futna_node.get_readonly_uri(), "imm." + future_nonascii_read_uri) + self.failUnless(isinstance(futna_metadata, dict), futna_metadata) + self.failIf(emptylit_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 257 - self.failUnlessEqual(emptylit_node.get_storage_index(), None) + self.failUnlessReallyEqual(emptylit_node.get_storage_index(), None) self.failIf(tinylit_node.is_unknown()) hunk ./src/allmydata/test/test_dirnode.py 259 - self.failUnlessEqual(tinylit_node.get_storage_index(), None) + self.failUnlessReallyEqual(tinylit_node.get_storage_index(), None) d2 = defer.succeed(None) d2.addCallback(lambda ignored: emptylit_node.list()) hunk ./src/allmydata/test/test_dirnode.py 265 d2.addCallback(lambda children: self.failUnlessEqual(children, {})) d2.addCallback(lambda ignored: tinylit_node.list()) - d2.addCallback(lambda children: self.failUnlessEqual(set(children.keys()), - set([u"short"]))) + d2.addCallback(lambda children: self.failUnlessReallyEqual(set(children.keys()), + set([u"short"]))) d2.addCallback(lambda ignored: tinylit_node.list()) d2.addCallback(lambda children: children[u"short"][0].read(MemAccum())) hunk ./src/allmydata/test/test_dirnode.py 269 - d2.addCallback(lambda accum: self.failUnlessEqual(accum.data, "The end.")) + d2.addCallback(lambda accum: self.failUnlessReallyEqual(accum.data, "The end.")) return d2 d.addCallback(_check_kids) hunk ./src/allmydata/test/test_dirnode.py 322 self.failUnless("RO-IMM" in rep) cap = dn.get_cap() self.failUnlessIn("LIT", cap.to_string()) - self.failUnlessEqual(cap.to_string(), "URI:DIR2-LIT:") + self.failUnlessReallyEqual(cap.to_string(), "URI:DIR2-LIT:") self.cap = cap return dn.list() d.addCallback(_created_empty) hunk ./src/allmydata/test/test_dirnode.py 340 self.failUnless("RO-IMM" in rep) cap = dn.get_cap() self.failUnlessIn("LIT", cap.to_string()) - self.failUnlessEqual(cap.to_string(), - "URI:DIR2-LIT:gi4tumj2n4wdcmz2kvjesosmjfkdu3rvpbtwwlbqhiwdeot3puwcy") + self.failUnlessReallyEqual(cap.to_string(), + "URI:DIR2-LIT:gi4tumj2n4wdcmz2kvjesosmjfkdu3rvpbtwwlbqhiwdeot3puwcy") self.cap = cap return dn.list() d.addCallback(_created_small) hunk ./src/allmydata/test/test_dirnode.py 345 - d.addCallback(lambda kids: self.failUnlessEqual(kids.keys(), [u"o"])) + d.addCallback(lambda kids: self.failUnlessReallyEqual(kids.keys(), [u"o"])) # now test n.create_subdirectory(mutable=False) d.addCallback(lambda ign: c.create_dirnode()) hunk ./src/allmydata/test/test_dirnode.py 355 d.addCallback(_check_kids) d.addCallback(lambda ign: n.list()) d.addCallback(lambda children: - self.failUnlessEqual(children.keys(), [u"subdir"])) + self.failUnlessReallyEqual(children.keys(), [u"subdir"])) d.addCallback(lambda ign: n.get(u"subdir")) d.addCallback(lambda sd: sd.list()) d.addCallback(_check_kids) hunk ./src/allmydata/test/test_dirnode.py 389 spacedout_read_uri = stripped_read_uri + " " child = nm.create_from_cap(spacedout_write_uri, spacedout_read_uri) - self.failUnlessEqual(child.get_write_uri(), spacedout_write_uri) - self.failUnlessEqual(child.get_readonly_uri(), "ro." + spacedout_read_uri) + self.failUnlessReallyEqual(child.get_write_uri(), spacedout_write_uri) + self.failUnlessReallyEqual(child.get_readonly_uri(), "ro." + spacedout_read_uri) child_dottedi = u"ch\u0131\u0307ld" hunk ./src/allmydata/test/test_dirnode.py 423 rw_uri = self.rootnode._decrypt_rwcapdata(rwcapdata) self.failUnlessIn(name, kids_out) (expected_child, ign) = kids_out[name] - self.failUnlessEqual(rw_uri, expected_child.get_write_uri()) - self.failUnlessEqual("ro." + ro_uri, expected_child.get_readonly_uri()) + self.failUnlessReallyEqual(rw_uri, expected_child.get_write_uri()) + self.failUnlessReallyEqual("ro." + ro_uri, expected_child.get_readonly_uri()) numkids += 1 hunk ./src/allmydata/test/test_dirnode.py 427 - self.failUnlessEqual(numkids, len(kids_out)) + self.failUnlessReallyEqual(numkids, len(kids_out)) return self.rootnode d.addCallback(_check_data) hunk ./src/allmydata/test/test_dirnode.py 456 # ro_uri, since it's unknown). Also the dotless-i + dot-above should have been # normalized to 'i'. - self.failUnlessEqual(set(children.keys()), set(kids_norm.keys())) + self.failUnlessReallyEqual(set(children.keys()), set(kids_norm.keys())) child_node, child_metadata = children[u"child"] hunk ./src/allmydata/test/test_dirnode.py 459 - self.failUnlessEqual(child_node.get_write_uri(), stripped_write_uri) - self.failUnlessEqual(child_node.get_readonly_uri(), "ro." + stripped_read_uri) + self.failUnlessReallyEqual(child_node.get_write_uri(), stripped_write_uri) + self.failUnlessReallyEqual(child_node.get_readonly_uri(), "ro." + stripped_read_uri) d.addCallback(_check_kids) d.addCallback(lambda ign: nm.create_from_cap(self.cap.to_string())) hunk ./src/allmydata/test/test_dirnode.py 516 def _check_results(r): self.failUnless(IDeepCheckResults.providedBy(r)) c = r.get_counters() - self.failUnlessEqual(c, - {"count-objects-checked": 4, - "count-objects-healthy": 4, - "count-objects-unhealthy": 0, - "count-objects-unrecoverable": 0, - "count-corrupt-shares": 0, - }) + self.failUnlessReallyEqual(c, + {"count-objects-checked": 4, + "count-objects-healthy": 4, + "count-objects-unhealthy": 0, + "count-objects-unrecoverable": 0, + "count-corrupt-shares": 0, + }) self.failIf(r.get_corrupt_shares()) hunk ./src/allmydata/test/test_dirnode.py 524 - self.failUnlessEqual(len(r.get_all_results()), 4) + self.failUnlessReallyEqual(len(r.get_all_results()), 4) d.addCallback(_check_results) return d hunk ./src/allmydata/test/test_dirnode.py 537 def _check_results(r): self.failUnless(IDeepCheckAndRepairResults.providedBy(r)) c = r.get_counters() - self.failUnlessEqual(c, - {"count-objects-checked": 4, - "count-objects-healthy-pre-repair": 4, - "count-objects-unhealthy-pre-repair": 0, - "count-objects-unrecoverable-pre-repair": 0, - "count-corrupt-shares-pre-repair": 0, - "count-objects-healthy-post-repair": 4, - "count-objects-unhealthy-post-repair": 0, - "count-objects-unrecoverable-post-repair": 0, - "count-corrupt-shares-post-repair": 0, - "count-repairs-attempted": 0, - "count-repairs-successful": 0, - "count-repairs-unsuccessful": 0, - }) + self.failUnlessReallyEqual(c, + {"count-objects-checked": 4, + "count-objects-healthy-pre-repair": 4, + "count-objects-unhealthy-pre-repair": 0, + "count-objects-unrecoverable-pre-repair": 0, + "count-corrupt-shares-pre-repair": 0, + "count-objects-healthy-post-repair": 4, + "count-objects-unhealthy-post-repair": 0, + "count-objects-unrecoverable-post-repair": 0, + "count-corrupt-shares-post-repair": 0, + "count-repairs-attempted": 0, + "count-repairs-successful": 0, + "count-repairs-unsuccessful": 0, + }) self.failIf(r.get_corrupt_shares()) self.failIf(r.get_remaining_corrupt_shares()) hunk ./src/allmydata/test/test_dirnode.py 553 - self.failUnlessEqual(len(r.get_all_results()), 4) + self.failUnlessReallyEqual(len(r.get_all_results()), 4) d.addCallback(_check_results) return d hunk ./src/allmydata/test/test_dirnode.py 569 d.addCallback(lambda rootnode: rootnode.start_deep_check().when_done()) def _check_results(r): c = r.get_counters() - self.failUnlessEqual(c, - {"count-objects-checked": 4, - "count-objects-healthy": 3, - "count-objects-unhealthy": 1, - "count-objects-unrecoverable": 0, - "count-corrupt-shares": 0, - }) - #self.failUnlessEqual(len(r.get_problems()), 1) # TODO + self.failUnlessReallyEqual(c, + {"count-objects-checked": 4, + "count-objects-healthy": 3, + "count-objects-unhealthy": 1, + "count-objects-unrecoverable": 0, + "count-corrupt-shares": 0, + }) + #self.failUnlessReallyEqual(len(r.get_problems()), 1) # TODO d.addCallback(_check_results) return d hunk ./src/allmydata/test/test_dirnode.py 658 u_v = n.get_verify_cap().to_string() self.failUnless(u_v.startswith("URI:DIR2-Verifier:"), u_v) u_r = n.get_repair_cap().to_string() - self.failUnlessEqual(u_r, u) + self.failUnlessReallyEqual(u_r, u) self.expected_manifest.append( ((), u) ) self.expected_verifycaps.add(u_v) si = n.get_storage_index() hunk ./src/allmydata/test/test_dirnode.py 664 self.expected_storage_indexes.add(base32.b2a(si)) expected_si = n._uri.get_storage_index() - self.failUnlessEqual(si, expected_si) + self.failUnlessReallyEqual(si, expected_si) d = n.list() d.addCallback(lambda res: self.failUnlessEqual(res, {})) hunk ./src/allmydata/test/test_dirnode.py 713 d.addCallback(lambda res: n.list()) d.addCallback(lambda children: - self.failUnlessEqual(set(children.keys()), - set([u"child", u"subdir"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"child", u"subdir"]))) d.addCallback(lambda res: n.start_deep_stats().when_done()) def _check_deepstats(stats): hunk ./src/allmydata/test/test_dirnode.py 732 "largest-immutable-file": 0, } for k,v in expected.iteritems(): - self.failUnlessEqual(stats[k], v, - "stats[%s] was %s, not %s" % - (k, stats[k], v)) + self.failUnlessReallyEqual(stats[k], v, + "stats[%s] was %s, not %s" % + (k, stats[k], v)) self.failUnless(stats["size-directories"] > 500, stats["size-directories"]) self.failUnless(stats["largest-directory"] > 500, hunk ./src/allmydata/test/test_dirnode.py 739 stats["largest-directory"]) - self.failUnlessEqual(stats["size-files-histogram"], []) + self.failUnlessReallyEqual(stats["size-files-histogram"], []) d.addCallback(_check_deepstats) d.addCallback(lambda res: n.build_manifest().when_done()) hunk ./src/allmydata/test/test_dirnode.py 745 def _check_manifest(res): manifest = res["manifest"] - self.failUnlessEqual(sorted(manifest), - sorted(self.expected_manifest)) + self.failUnlessReallyEqual(sorted(manifest), + sorted(self.expected_manifest)) stats = res["stats"] _check_deepstats(stats) hunk ./src/allmydata/test/test_dirnode.py 749 - self.failUnlessEqual(self.expected_verifycaps, - res["verifycaps"]) - self.failUnlessEqual(self.expected_storage_indexes, - res["storage-index"]) + self.failUnlessReallyEqual(self.expected_verifycaps, + res["verifycaps"]) + self.failUnlessReallyEqual(self.expected_storage_indexes, + res["storage-index"]) d.addCallback(_check_manifest) def _add_subsubdir(res): hunk ./src/allmydata/test/test_dirnode.py 767 self.failUnless(isinstance(subsubdir, dirnode.DirectoryNode))) d.addCallback(lambda res: n.get_child_at_path(u"")) - d.addCallback(lambda res: self.failUnlessEqual(res.get_uri(), - n.get_uri())) + d.addCallback(lambda res: self.failUnlessReallyEqual(res.get_uri(), + n.get_uri())) d.addCallback(lambda res: n.get_metadata_for(u"child")) d.addCallback(lambda metadata: hunk ./src/allmydata/test/test_dirnode.py 772 - self.failUnlessEqual(set(metadata.keys()), - set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), + set(["tahoe"]))) d.addCallback(lambda res: self.shouldFail(NoSuchChildError, "gcamap-no", hunk ./src/allmydata/test/test_dirnode.py 786 child, metadata = res self.failUnless(isinstance(child, dirnode.DirectoryNode)) # edge-metadata needs at least one path segment - self.failUnlessEqual(set(metadata.keys()), set([])) + self.failUnlessReallyEqual(set(metadata.keys()), set([])) d.addCallback(_check_child_and_metadata1) d.addCallback(lambda res: n.get_child_and_metadata_at_path(u"child")) hunk ./src/allmydata/test/test_dirnode.py 793 def _check_child_and_metadata2(res): child, metadata = res - self.failUnlessEqual(child.get_uri(), - fake_file_uri) - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"])) + self.failUnlessReallyEqual(child.get_uri(), + fake_file_uri) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"])) d.addCallback(_check_child_and_metadata2) d.addCallback(lambda res: hunk ./src/allmydata/test/test_dirnode.py 803 def _check_child_and_metadata3(res): child, metadata = res self.failUnless(isinstance(child, dirnode.DirectoryNode)) - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"])) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"])) d.addCallback(_check_child_and_metadata3) # set_uri + metadata hunk ./src/allmydata/test/test_dirnode.py 813 {})) d.addCallback(lambda res: n.get_metadata_for(u"c2")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) # You can't override the link timestamps. d.addCallback(lambda res: n.set_uri(u"c2", hunk ./src/allmydata/test/test_dirnode.py 831 fake_file_uri, fake_file_uri)) d.addCallback(lambda res: n.get_metadata_for(u"c3")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) # we can also add specific metadata at set_uri() time d.addCallback(lambda res: n.set_uri(u"c4", hunk ./src/allmydata/test/test_dirnode.py 857 overwrite=False)) d.addCallback(lambda res: n.get_metadata_for(u"d2")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) # if we don't set any defaults, the child should get timestamps d.addCallback(lambda res: n.set_node(u"d3", n)) hunk ./src/allmydata/test/test_dirnode.py 863 d.addCallback(lambda res: n.get_metadata_for(u"d3")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) # we can also add specific metadata at set_node() time d.addCallback(lambda res: n.set_node(u"d4", n, hunk ./src/allmydata/test/test_dirnode.py 901 d.addCallback(lambda children: self.failIf(u"new" in children)) d.addCallback(lambda res: n.get_metadata_for(u"e1")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) d.addCallback(lambda res: n.get_metadata_for(u"e2")) d.addCallback(lambda metadata: hunk ./src/allmydata/test/test_dirnode.py 904 - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) d.addCallback(lambda res: n.get_metadata_for(u"e3")) d.addCallback(lambda metadata: self.failUnless((set(metadata.keys()) == set(["key", "tahoe"])) and hunk ./src/allmydata/test/test_dirnode.py 932 d.addCallback(lambda children: self.failIf(u"new" in children)) d.addCallback(lambda res: n.get_metadata_for(u"f1")) d.addCallback(lambda metadata: - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) d.addCallback(lambda res: n.get_metadata_for(u"f2")) d.addCallback(lambda metadata: hunk ./src/allmydata/test/test_dirnode.py 935 - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) d.addCallback(lambda res: n.get_metadata_for(u"f3")) d.addCallback(lambda metadata: self.failUnless((set(metadata.keys()) == set(["key", "tahoe"])) and hunk ./src/allmydata/test/test_dirnode.py 978 d.addCallback(lambda res: n.get_metadata_for(u"timestamps")) def _check_timestamp1(metadata): - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"])) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"])) tahoe_md = metadata["tahoe"] hunk ./src/allmydata/test/test_dirnode.py 980 - self.failUnlessEqual(set(tahoe_md.keys()), set(["linkcrtime", "linkmotime"])) + self.failUnlessReallyEqual(set(tahoe_md.keys()), set(["linkcrtime", "linkmotime"])) self.failUnlessGreaterOrEqualThan(tahoe_md["linkcrtime"], self._start_timestamp) hunk ./src/allmydata/test/test_dirnode.py 1002 def _check_timestamp2(metadata): self.failUnlessIn("tahoe", metadata) tahoe_md = metadata["tahoe"] - self.failUnlessEqual(set(tahoe_md.keys()), set(["linkcrtime", "linkmotime"])) + self.failUnlessReallyEqual(set(tahoe_md.keys()), set(["linkcrtime", "linkmotime"])) hunk ./src/allmydata/test/test_dirnode.py 1004 - self.failUnlessEqual(tahoe_md["linkcrtime"], self._old_linkcrtime) + self.failUnlessReallyEqual(tahoe_md["linkcrtime"], self._old_linkcrtime) self.failUnlessGreaterThan(tahoe_md["linkmotime"], self._old_linkmotime) return n.delete(u"timestamps") d.addCallback(_check_timestamp2) hunk ./src/allmydata/test/test_dirnode.py 1011 d.addCallback(lambda res: n.delete(u"subdir")) d.addCallback(lambda old_child: - self.failUnlessEqual(old_child.get_uri(), + self.failUnlessReallyEqual(old_child.get_uri(), self.subdir.get_uri())) d.addCallback(lambda res: n.list()) hunk ./src/allmydata/test/test_dirnode.py 1016 d.addCallback(lambda children: - self.failUnlessEqual(set(children.keys()), - set([u"child"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"child"]))) uploadable1 = upload.Data("some data", convergence="converge") d.addCallback(lambda res: n.add_file(u"newfile", uploadable1)) hunk ./src/allmydata/test/test_dirnode.py 1032 overwrite=False)) d.addCallback(lambda res: n.list()) d.addCallback(lambda children: - self.failUnlessEqual(set(children.keys()), - set([u"child", u"newfile"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"child", u"newfile"]))) d.addCallback(lambda res: n.get_metadata_for(u"newfile")) d.addCallback(lambda metadata: hunk ./src/allmydata/test/test_dirnode.py 1036 - self.failUnlessEqual(set(metadata.keys()), set(["tahoe"]))) + self.failUnlessReallyEqual(set(metadata.keys()), set(["tahoe"]))) uploadable3 = upload.Data("some data", convergence="converge") d.addCallback(lambda res: n.add_file(u"newfile-metadata", hunk ./src/allmydata/test/test_dirnode.py 1062 n.move_child_to(u"child", self.subdir2)) d.addCallback(lambda res: n.list()) d.addCallback(lambda children: - self.failUnlessEqual(set(children.keys()), - set([u"newfile", u"subdir2"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"newfile", u"subdir2"]))) d.addCallback(lambda res: self.subdir2.list()) d.addCallback(lambda children: hunk ./src/allmydata/test/test_dirnode.py 1066 - self.failUnlessEqual(set(children.keys()), - set([u"child"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"child"]))) d.addCallback(lambda res: self.subdir2.get(u"child")) d.addCallback(lambda child: hunk ./src/allmydata/test/test_dirnode.py 1070 - self.failUnlessEqual(child.get_uri(), - fake_file_uri)) + self.failUnlessReallyEqual(child.get_uri(), + fake_file_uri)) # move it back, using new_child_name= d.addCallback(lambda res: hunk ./src/allmydata/test/test_dirnode.py 1078 self.subdir2.move_child_to(u"child", n, u"newchild")) d.addCallback(lambda res: n.list()) d.addCallback(lambda children: - self.failUnlessEqual(set(children.keys()), - set([u"newchild", u"newfile", - u"subdir2"]))) + self.failUnlessReallyEqual(set(children.keys()), + set([u"newchild", u"newfile", + u"subdir2"]))) d.addCallback(lambda res: self.subdir2.list()) d.addCallback(lambda children: hunk ./src/allmydata/test/test_dirnode.py 1083 - self.failUnlessEqual(set(children.keys()), set([]))) + self.failUnlessReallyEqual(set(children.keys()), set([]))) # now make sure that we honor overwrite=False d.addCallback(lambda res: hunk ./src/allmydata/test/test_dirnode.py 1098 overwrite=False)) d.addCallback(lambda res: self.subdir2.get(u"newchild")) d.addCallback(lambda child: - self.failUnlessEqual(child.get_uri(), - other_file_uri)) + self.failUnlessReallyEqual(child.get_uri(), + other_file_uri)) # Setting the no-write field should diminish a mutable cap to read-only hunk ./src/allmydata/test/test_dirnode.py 1141 (t1, t2, t3) = (626644800.0, 634745640.0, 892226160.0) md1 = dirnode.update_metadata({"ctime": t1}, {}, t2) - self.failUnlessEqual(md1, {"tahoe":{"linkcrtime": t1, "linkmotime": t2}}) + self.failUnlessReallyEqual(md1, {"tahoe":{"linkcrtime": t1, "linkmotime": t2}}) md2 = dirnode.update_metadata(md1, {"key": "value", "tahoe": {"bad": "mojo"}}, t3) hunk ./src/allmydata/test/test_dirnode.py 1144 - self.failUnlessEqual(md2, {"key": "value", - "tahoe":{"linkcrtime": t1, "linkmotime": t3}}) + self.failUnlessReallyEqual(md2, {"key": "value", + "tahoe":{"linkcrtime": t1, "linkmotime": t3}}) md3 = dirnode.update_metadata({}, None, t3) hunk ./src/allmydata/test/test_dirnode.py 1148 - self.failUnlessEqual(md3, {"tahoe":{"linkcrtime": t3, "linkmotime": t3}}) + self.failUnlessReallyEqual(md3, {"tahoe":{"linkcrtime": t3, "linkmotime": t3}}) md4 = dirnode.update_metadata({}, {"bool": True, "number": 42}, t1) hunk ./src/allmydata/test/test_dirnode.py 1151 - self.failUnlessEqual(md4, {"bool": True, "number": 42, - "tahoe":{"linkcrtime": t1, "linkmotime": t1}}) + self.failUnlessReallyEqual(md4, {"bool": True, "number": 42, + "tahoe":{"linkcrtime": t1, "linkmotime": t1}}) def test_create_subdirectory(self): self.basedir = "dirnode/Dirnode/test_create_subdirectory" hunk ./src/allmydata/test/test_dirnode.py 1173 d = n.create_subdirectory(u"subdir", kids) def _check(sub): d = n.get_child_at_path(u"subdir") - d.addCallback(lambda sub2: self.failUnlessEqual(sub2.get_uri(), - sub.get_uri())) + d.addCallback(lambda sub2: self.failUnlessReallyEqual(sub2.get_uri(), + sub.get_uri())) d.addCallback(lambda ign: sub.list()) return d d.addCallback(_check) hunk ./src/allmydata/test/test_dirnode.py 1179 def _check_kids(kids2): - self.failUnlessEqual(set(kids.keys()), set(kids2.keys())) - self.failUnlessEqual(kids2[u"kid2"][1]["metakey"], "metavalue") + self.failUnlessReallyEqual(set(kids.keys()), set(kids2.keys())) + self.failUnlessReallyEqual(kids2[u"kid2"][1]["metakey"], "metavalue") d.addCallback(_check_kids) return d d.addCallback(_then) hunk ./src/allmydata/test/test_dirnode.py 1190 def get_writekey(self): return "writekey" -class Packing(unittest.TestCase): +class Packing(testutil.ReallyEqualMixin, unittest.TestCase): # This is a base32-encoded representation of the directory tree # root/file1 # root/file2 hunk ./src/allmydata/test/test_dirnode.py 1227 file3_rocap = "URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:3:10:5" file3_rwcap = "URI:CHK:cmtcxq7hwxvfxan34yiev6ivhy:qvcekmjtoetdcw4kmi7b3rtblvgx7544crnwaqtiewemdliqsokq:3:10:5" file3_metadata = {'ctime': 1246663897.4336269, 'tahoe': {'linkmotime': 1246663897.4336269, 'linkcrtime': 1246663897.4336269}, 'mtime': 1246663897.4336269} - self.failUnlessEqual(file3_metadata, children[u'file3'][1]) - self.failUnlessEqual(file3_rocap, - children[u'file3'][0].get_readonly_uri()) - self.failUnlessEqual(file3_rwcap, - children[u'file3'][0].get_uri()) + self.failUnlessReallyEqual(file3_metadata, children[u'file3'][1]) + self.failUnlessReallyEqual(file3_rocap, + children[u'file3'][0].get_readonly_uri()) + self.failUnlessReallyEqual(file3_rwcap, + children[u'file3'][0].get_uri()) # Are the metadata for child 2 right? file2_rocap = "URI:CHK:apegrpehshwugkbh3jlt5ei6hq:5oougnemcl5xgx4ijgiumtdojlipibctjkbwvyygdymdphib2fvq:3:10:4" hunk ./src/allmydata/test/test_dirnode.py 1237 file2_rwcap = "URI:CHK:apegrpehshwugkbh3jlt5ei6hq:5oougnemcl5xgx4ijgiumtdojlipibctjkbwvyygdymdphib2fvq:3:10:4" file2_metadata = {'ctime': 1246663897.430218, 'tahoe': {'linkmotime': 1246663897.430218, 'linkcrtime': 1246663897.430218}, 'mtime': 1246663897.430218} - self.failUnlessEqual(file2_metadata, children[u'file2'][1]) - self.failUnlessEqual(file2_rocap, + self.failUnlessReallyEqual(file2_metadata, children[u'file2'][1]) + self.failUnlessReallyEqual(file2_rocap, children[u'file2'][0].get_readonly_uri()) hunk ./src/allmydata/test/test_dirnode.py 1240 - self.failUnlessEqual(file2_rwcap, + self.failUnlessReallyEqual(file2_rwcap, children[u'file2'][0].get_uri()) # Are the metadata for child 1 right? hunk ./src/allmydata/test/test_dirnode.py 1247 file1_rocap = "URI:CHK:olxtimympo7f27jvhtgqlnbtn4:emzdnhk2um4seixozlkw3qx2nfijvdkx3ky7i7izl47yedl6e64a:3:10:10" file1_rwcap = "URI:CHK:olxtimympo7f27jvhtgqlnbtn4:emzdnhk2um4seixozlkw3qx2nfijvdkx3ky7i7izl47yedl6e64a:3:10:10" file1_metadata = {'ctime': 1246663897.4275661, 'tahoe': {'linkmotime': 1246663897.4275661, 'linkcrtime': 1246663897.4275661}, 'mtime': 1246663897.4275661} - self.failUnlessEqual(file1_metadata, children[u'file1'][1]) - self.failUnlessEqual(file1_rocap, + self.failUnlessReallyEqual(file1_metadata, children[u'file1'][1]) + self.failUnlessReallyEqual(file1_rocap, children[u'file1'][0].get_readonly_uri()) hunk ./src/allmydata/test/test_dirnode.py 1250 - self.failUnlessEqual(file1_rwcap, + self.failUnlessReallyEqual(file1_rwcap, children[u'file1'][0].get_uri()) def _make_kids(self, nm, which): hunk ./src/allmydata/test/test_dirnode.py 1367 def create_node_from_uri(self, rwcap, rocap): return self.nodemaker.create_from_cap(rwcap, rocap) -class Dirnode2(unittest.TestCase, testutil.ShouldFailMixin): +class Dirnode2(testutil.ReallyEqualMixin, testutil.ShouldFailMixin, unittest.TestCase): def setUp(self): client = FakeClient2() self.nodemaker = client.nodemaker hunk ./src/allmydata/test/test_dirnode.py 1376 # Create a mutable directory that contains unknown URI types, and make sure # we tolerate them properly. d = self.nodemaker.create_new_mutable_directory() - future_write_uri = "x-tahoe-crazy://I_am_from_the_future." - future_read_uri = "x-tahoe-crazy-readonly://I_am_from_the_future." - future_imm_uri = "x-tahoe-crazy-immutable://I_am_from_the_future." + future_write_uri = u"x-tahoe-crazy://I_am_from_the_future_rw_\u263A".encode('utf-8') + future_read_uri = u"x-tahoe-crazy-readonly://I_am_from_the_future_ro_\u263A".encode('utf-8') + future_imm_uri = u"x-tahoe-crazy-immutable://I_am_from_the_future_imm_\u263A".encode('utf-8') future_node = UnknownNode(future_write_uri, future_read_uri) def _then(n): self._node = n hunk ./src/allmydata/test/test_dirnode.py 1409 d.addCallback(lambda ign: self._node.list()) def _check(children): - self.failUnlessEqual(len(children), 4) + self.failUnlessReallyEqual(len(children), 4) (fn, metadata) = children[u"future"] self.failUnless(isinstance(fn, UnknownNode), fn) hunk ./src/allmydata/test/test_dirnode.py 1412 - self.failUnlessEqual(fn.get_uri(), future_write_uri) - self.failUnlessEqual(fn.get_write_uri(), future_write_uri) - self.failUnlessEqual(fn.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fn.get_uri(), future_write_uri) + self.failUnlessReallyEqual(fn.get_write_uri(), future_write_uri) + self.failUnlessReallyEqual(fn.get_readonly_uri(), "ro." + future_read_uri) (fn2, metadata2) = children[u"add-pair"] self.failUnless(isinstance(fn2, UnknownNode), fn2) hunk ./src/allmydata/test/test_dirnode.py 1418 - self.failUnlessEqual(fn2.get_uri(), future_write_uri) - self.failUnlessEqual(fn2.get_write_uri(), future_write_uri) - self.failUnlessEqual(fn2.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fn2.get_uri(), future_write_uri) + self.failUnlessReallyEqual(fn2.get_write_uri(), future_write_uri) + self.failUnlessReallyEqual(fn2.get_readonly_uri(), "ro." + future_read_uri) (fn3, metadata3) = children[u"add-ro"] self.failUnless(isinstance(fn3, UnknownNode), fn3) hunk ./src/allmydata/test/test_dirnode.py 1424 - self.failUnlessEqual(fn3.get_uri(), "ro." + future_read_uri) - self.failUnlessEqual(fn3.get_write_uri(), None) - self.failUnlessEqual(fn3.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fn3.get_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fn3.get_write_uri(), None) + self.failUnlessReallyEqual(fn3.get_readonly_uri(), "ro." + future_read_uri) (fn4, metadata4) = children[u"add-imm"] self.failUnless(isinstance(fn4, UnknownNode), fn4) hunk ./src/allmydata/test/test_dirnode.py 1430 - self.failUnlessEqual(fn4.get_uri(), "imm." + future_imm_uri) - self.failUnlessEqual(fn4.get_write_uri(), None) - self.failUnlessEqual(fn4.get_readonly_uri(), "imm." + future_imm_uri) + self.failUnlessReallyEqual(fn4.get_uri(), "imm." + future_imm_uri) + self.failUnlessReallyEqual(fn4.get_write_uri(), None) + self.failUnlessReallyEqual(fn4.get_readonly_uri(), "imm." + future_imm_uri) # We should also be allowed to copy the "future" UnknownNode, because # it contains all the information that was in the original directory hunk ./src/allmydata/test/test_dirnode.py 1442 d.addCallback(lambda ign: self._node.list()) def _check2(children): - self.failUnlessEqual(len(children), 5) + self.failUnlessReallyEqual(len(children), 5) (fn, metadata) = children[u"copy"] self.failUnless(isinstance(fn, UnknownNode), fn) hunk ./src/allmydata/test/test_dirnode.py 1445 - self.failUnlessEqual(fn.get_uri(), future_write_uri) - self.failUnlessEqual(fn.get_write_uri(), future_write_uri) - self.failUnlessEqual(fn.get_readonly_uri(), "ro." + future_read_uri) + self.failUnlessReallyEqual(fn.get_uri(), future_write_uri) + self.failUnlessReallyEqual(fn.get_write_uri(), future_write_uri) + self.failUnlessReallyEqual(fn.get_readonly_uri(), "ro." + future_read_uri) d.addCallback(_check2) return d hunk ./src/allmydata/test/test_dirnode.py 1452 def test_unknown_strip_prefix_for_ro(self): - self.failUnlessEqual(strip_prefix_for_ro("foo", False), "foo") - self.failUnlessEqual(strip_prefix_for_ro("ro.foo", False), "foo") - self.failUnlessEqual(strip_prefix_for_ro("imm.foo", False), "imm.foo") - self.failUnlessEqual(strip_prefix_for_ro("foo", True), "foo") - self.failUnlessEqual(strip_prefix_for_ro("ro.foo", True), "foo") - self.failUnlessEqual(strip_prefix_for_ro("imm.foo", True), "foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("foo", False), "foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("ro.foo", False), "foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("imm.foo", False), "imm.foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("foo", True), "foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("ro.foo", True), "foo") + self.failUnlessReallyEqual(strip_prefix_for_ro("imm.foo", True), "foo") def test_unknownnode(self): mut_write_uri = "URI:SSK:vfvcbdfbszyrsaxchgevhmmlii:euw4iw7bbnkrrwpzuburbhppuxhc3gwxv26f6imekhz7zyw2ojnq" hunk ./src/allmydata/test/test_dirnode.py 1555 self.failUnless(n.get_readonly_uri().startswith("imm."), i) -class DeepStats(unittest.TestCase): +class DeepStats(testutil.ReallyEqualMixin, unittest.TestCase): timeout = 240 # It takes longer than 120 seconds on Francois's arm box. def test_stats(self): ds = dirnode.DeepStats(None) hunk ./src/allmydata/test/test_dirnode.py 1565 ds.max("largest-directory", 444) s = ds.get_results() - self.failUnlessEqual(s["count-files"], 1) - self.failUnlessEqual(s["size-immutable-files"], 123) - self.failUnlessEqual(s["largest-directory"], 444) - self.failUnlessEqual(s["count-literal-files"], 0) + self.failUnlessReallyEqual(s["count-files"], 1) + self.failUnlessReallyEqual(s["size-immutable-files"], 123) + self.failUnlessReallyEqual(s["largest-directory"], 444) + self.failUnlessReallyEqual(s["count-literal-files"], 0) ds.add("count-files") ds.add("size-immutable-files", 321) hunk ./src/allmydata/test/test_dirnode.py 1576 ds.max("largest-directory", 2) s = ds.get_results() - self.failUnlessEqual(s["count-files"], 2) - self.failUnlessEqual(s["size-immutable-files"], 444) - self.failUnlessEqual(s["largest-directory"], 444) - self.failUnlessEqual(s["count-literal-files"], 0) - self.failUnlessEqual(s["size-files-histogram"], + self.failUnlessReallyEqual(s["count-files"], 2) + self.failUnlessReallyEqual(s["size-immutable-files"], 444) + self.failUnlessReallyEqual(s["largest-directory"], 444) + self.failUnlessReallyEqual(s["count-literal-files"], 0) + self.failUnlessReallyEqual(s["size-files-histogram"], [ (101, 316, 1), (317, 1000, 1) ]) ds = dirnode.DeepStats(None) hunk ./src/allmydata/test/test_dirnode.py 1588 ds.histogram("size-files-histogram", i) ds.histogram("size-files-histogram", 4*1000*1000*1000*1000) # 4TB s = ds.get_results() - self.failUnlessEqual(s["size-files-histogram"], + self.failUnlessReallyEqual(s["size-files-histogram"], [ (1, 3, 3), (4, 10, 7), (11, 31, 21), hunk ./src/allmydata/test/test_dirnode.py 1620 return n.init_from_cap(cap) -class Deleter(GridTestMixin, unittest.TestCase): +class Deleter(GridTestMixin, testutil.ReallyEqualMixin, unittest.TestCase): timeout = 3600 # It takes longer than 433 seconds on Zandr's ARM box. def test_retry(self): # ticket #550, a dirnode.delete which experiences an hunk ./src/allmydata/test/test_uri.py 7 from allmydata.util import hashutil, base32 from allmydata.interfaces import IURI, IFileURI, IDirnodeURI, IMutableFileURI, \ IVerifierURI, CapConstraintError +import allmydata.test.common_util as testutil hunk ./src/allmydata/test/test_uri.py 9 -class Literal(unittest.TestCase): +class Literal(testutil.ReallyEqualMixin, unittest.TestCase): def _help_test(self, data): u = uri.LiteralFileURI(data) self.failUnless(IURI.providedBy(u)) hunk ./src/allmydata/test/test_uri.py 15 self.failUnless(IFileURI.providedBy(u)) self.failIf(IDirnodeURI.providedBy(u)) - self.failUnlessEqual(u.data, data) - self.failUnlessEqual(u.get_size(), len(data)) + self.failUnlessReallyEqual(u.data, data) + self.failUnlessReallyEqual(u.get_size(), len(data)) self.failUnless(u.is_readonly()) self.failIf(u.is_mutable()) hunk ./src/allmydata/test/test_uri.py 24 self.failUnless(IURI.providedBy(u2)) self.failUnless(IFileURI.providedBy(u2)) self.failIf(IDirnodeURI.providedBy(u2)) - self.failUnlessEqual(u2.data, data) - self.failUnlessEqual(u2.get_size(), len(data)) + self.failUnlessReallyEqual(u2.data, data) + self.failUnlessReallyEqual(u2.get_size(), len(data)) self.failUnless(u2.is_readonly()) self.failIf(u2.is_mutable()) hunk ./src/allmydata/test/test_uri.py 32 u2i = uri.from_string(u.to_string(), deep_immutable=True) self.failUnless(IFileURI.providedBy(u2i)) self.failIf(IDirnodeURI.providedBy(u2i)) - self.failUnlessEqual(u2i.data, data) - self.failUnlessEqual(u2i.get_size(), len(data)) + self.failUnlessReallyEqual(u2i.data, data) + self.failUnlessReallyEqual(u2i.get_size(), len(data)) self.failUnless(u2i.is_readonly()) self.failIf(u2i.is_mutable()) hunk ./src/allmydata/test/test_uri.py 39 u3 = u.get_readonly() self.failUnlessIdentical(u, u3) - self.failUnlessEqual(u.get_verify_cap(), None) + self.failUnlessReallyEqual(u.get_verify_cap(), None) he = u.to_human_encoding() u_h = uri.LiteralFileURI.init_from_human_encoding(he) hunk ./src/allmydata/test/test_uri.py 43 - self.failUnlessEqual(u, u_h) + self.failUnlessReallyEqual(u, u_h) def test_empty(self): data = "" # This data is some *very* small data! hunk ./src/allmydata/test/test_uri.py 57 data = "This contains \x00 and URI:LIT: and \n, oh my." return self._help_test(data) -class Compare(unittest.TestCase): +class Compare(testutil.ReallyEqualMixin, unittest.TestCase): def test_compare(self): lit1 = uri.LiteralFileURI("some data") fileURI = 'URI:CHK:f5ahxa25t4qkktywz6teyfvcx4:opuioq7tj2y6idzfp6cazehtmgs5fdcebcz3cygrxyydvcozrmeq:3:10:345834' hunk ./src/allmydata/test/test_uri.py 65 chk2 = uri.CHKFileURI.init_from_string(fileURI) unk = uri.UnknownURI("lafs://from_the_future") self.failIfEqual(lit1, chk1) - self.failUnlessEqual(chk1, chk2) + self.failUnlessReallyEqual(chk1, chk2) self.failIfEqual(chk1, "not actually a URI") # these should be hashable too s = set([lit1, chk1, chk2, unk]) hunk ./src/allmydata/test/test_uri.py 69 - self.failUnlessEqual(len(s), 3) # since chk1==chk2 + self.failUnlessReallyEqual(len(s), 3) # since chk1==chk2 def test_is_uri(self): lit1 = uri.LiteralFileURI("some data").to_string() hunk ./src/allmydata/test/test_uri.py 93 self.failIf(uri.has_uri_prefix(None)) self.failIf(uri.has_uri_prefix("foo")) -class CHKFile(unittest.TestCase): +class CHKFile(testutil.ReallyEqualMixin, unittest.TestCase): def test_pack(self): key = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" storage_index = hashutil.storage_index_hash(key) hunk ./src/allmydata/test/test_uri.py 106 needed_shares=needed_shares, total_shares=total_shares, size=size) - self.failUnlessEqual(u.get_storage_index(), storage_index) - self.failUnlessEqual(u.key, key) - self.failUnlessEqual(u.uri_extension_hash, uri_extension_hash) - self.failUnlessEqual(u.needed_shares, needed_shares) - self.failUnlessEqual(u.total_shares, total_shares) - self.failUnlessEqual(u.size, size) + self.failUnlessReallyEqual(u.get_storage_index(), storage_index) + self.failUnlessReallyEqual(u.key, key) + self.failUnlessReallyEqual(u.uri_extension_hash, uri_extension_hash) + self.failUnlessReallyEqual(u.needed_shares, needed_shares) + self.failUnlessReallyEqual(u.total_shares, total_shares) + self.failUnlessReallyEqual(u.size, size) self.failUnless(u.is_readonly()) self.failIf(u.is_mutable()) self.failUnless(IURI.providedBy(u)) hunk ./src/allmydata/test/test_uri.py 117 self.failUnless(IFileURI.providedBy(u)) self.failIf(IDirnodeURI.providedBy(u)) - self.failUnlessEqual(u.get_size(), 1234) + self.failUnlessReallyEqual(u.get_size(), 1234) u_ro = u.get_readonly() self.failUnlessIdentical(u, u_ro) hunk ./src/allmydata/test/test_uri.py 122 he = u.to_human_encoding() - self.failUnlessEqual(he, "http://127.0.0.1:3456/uri/" + u.to_string()) - self.failUnlessEqual(uri.CHKFileURI.init_from_human_encoding(he), u) + self.failUnlessReallyEqual(he, "http://127.0.0.1:3456/uri/" + u.to_string()) + self.failUnlessReallyEqual(uri.CHKFileURI.init_from_human_encoding(he), u) u2 = uri.from_string(u.to_string()) hunk ./src/allmydata/test/test_uri.py 126 - self.failUnlessEqual(u2.get_storage_index(), storage_index) - self.failUnlessEqual(u2.key, key) - self.failUnlessEqual(u2.uri_extension_hash, uri_extension_hash) - self.failUnlessEqual(u2.needed_shares, needed_shares) - self.failUnlessEqual(u2.total_shares, total_shares) - self.failUnlessEqual(u2.size, size) + self.failUnlessReallyEqual(u2.get_storage_index(), storage_index) + self.failUnlessReallyEqual(u2.key, key) + self.failUnlessReallyEqual(u2.uri_extension_hash, uri_extension_hash) + self.failUnlessReallyEqual(u2.needed_shares, needed_shares) + self.failUnlessReallyEqual(u2.total_shares, total_shares) + self.failUnlessReallyEqual(u2.size, size) self.failUnless(u2.is_readonly()) self.failIf(u2.is_mutable()) self.failUnless(IURI.providedBy(u2)) hunk ./src/allmydata/test/test_uri.py 137 self.failUnless(IFileURI.providedBy(u2)) self.failIf(IDirnodeURI.providedBy(u2)) - self.failUnlessEqual(u2.get_size(), 1234) + self.failUnlessReallyEqual(u2.get_size(), 1234) u2i = uri.from_string(u.to_string(), deep_immutable=True) hunk ./src/allmydata/test/test_uri.py 140 - self.failUnlessEqual(u.to_string(), u2i.to_string()) + self.failUnlessReallyEqual(u.to_string(), u2i.to_string()) u2ro = uri.from_string(uri.ALLEGED_READONLY_PREFIX + u.to_string()) hunk ./src/allmydata/test/test_uri.py 142 - self.failUnlessEqual(u.to_string(), u2ro.to_string()) + self.failUnlessReallyEqual(u.to_string(), u2ro.to_string()) u2imm = uri.from_string(uri.ALLEGED_IMMUTABLE_PREFIX + u.to_string()) hunk ./src/allmydata/test/test_uri.py 144 - self.failUnlessEqual(u.to_string(), u2imm.to_string()) + self.failUnlessReallyEqual(u.to_string(), u2imm.to_string()) v = u.get_verify_cap() self.failUnless(isinstance(v.to_string(), str)) hunk ./src/allmydata/test/test_uri.py 152 self.failIf(v.is_mutable()) v2 = uri.from_string(v.to_string()) - self.failUnlessEqual(v, v2) + self.failUnlessReallyEqual(v, v2) he = v.to_human_encoding() v2_h = uri.CHKFileVerifierURI.init_from_human_encoding(he) hunk ./src/allmydata/test/test_uri.py 155 - self.failUnlessEqual(v2, v2_h) + self.failUnlessReallyEqual(v2, v2_h) v3 = uri.CHKFileVerifierURI(storage_index="\x00"*16, uri_extension_hash="\x00"*32, hunk ./src/allmydata/test/test_uri.py 196 ) -class Extension(unittest.TestCase): +class Extension(testutil.ReallyEqualMixin, unittest.TestCase): def test_pack(self): data = {"stuff": "value", "size": 12, hunk ./src/allmydata/test/test_uri.py 205 } ext = uri.pack_extension(data) d = uri.unpack_extension(ext) - self.failUnlessEqual(d["stuff"], "value") - self.failUnlessEqual(d["size"], 12) - self.failUnlessEqual(d["big_hash"], hashutil.tagged_hash("foo", "bar")) + self.failUnlessReallyEqual(d["stuff"], "value") + self.failUnlessReallyEqual(d["size"], 12) + self.failUnlessReallyEqual(d["big_hash"], hashutil.tagged_hash("foo", "bar")) readable = uri.unpack_extension_readable(ext) hunk ./src/allmydata/test/test_uri.py 210 - self.failUnlessEqual(readable["needed_shares"], 3) - self.failUnlessEqual(readable["stuff"], "value") - self.failUnlessEqual(readable["size"], 12) - self.failUnlessEqual(readable["big_hash"], + self.failUnlessReallyEqual(readable["needed_shares"], 3) + self.failUnlessReallyEqual(readable["stuff"], "value") + self.failUnlessReallyEqual(readable["size"], 12) + self.failUnlessReallyEqual(readable["big_hash"], base32.b2a(hashutil.tagged_hash("foo", "bar"))) hunk ./src/allmydata/test/test_uri.py 215 - self.failUnlessEqual(readable["UEB_hash"], + self.failUnlessReallyEqual(readable["UEB_hash"], base32.b2a(hashutil.uri_extension_hash(ext))) hunk ./src/allmydata/test/test_uri.py 218 -class Unknown(unittest.TestCase): +class Unknown(testutil.ReallyEqualMixin, unittest.TestCase): def test_from_future(self): # any URI type that we don't recognize should be treated as unknown future_uri = "I am a URI from the future. Whatever you do, don't " hunk ./src/allmydata/test/test_uri.py 224 u = uri.from_string(future_uri) self.failUnless(isinstance(u, uri.UnknownURI)) - self.failUnlessEqual(u.to_string(), future_uri) + self.failUnlessReallyEqual(u.to_string(), future_uri) self.failUnless(u.get_readonly() is None) self.failUnless(u.get_error() is None) hunk ./src/allmydata/test/test_uri.py 229 u2 = uri.UnknownURI(future_uri, error=CapConstraintError("...")) - self.failUnlessEqual(u.to_string(), future_uri) + self.failUnlessReallyEqual(u.to_string(), future_uri) self.failUnless(u2.get_readonly() is None) self.failUnless(isinstance(u2.get_error(), CapConstraintError)) hunk ./src/allmydata/test/test_uri.py 233 -class Constraint(unittest.TestCase): + # Future caps might have non-ASCII chars in them. (Or maybe not, who can tell about the future?) + future_uri = u"I am a cap from the \u263A future. Whatever you ".encode('utf-8') + u = uri.from_string(future_uri) + self.failUnless(isinstance(u, uri.UnknownURI)) + self.failUnlessReallyEqual(u.to_string(), future_uri) + self.failUnless(u.get_readonly() is None) + self.failUnless(u.get_error() is None) + + u2 = uri.UnknownURI(future_uri, error=CapConstraintError("...")) + self.failUnlessReallyEqual(u.to_string(), future_uri) + self.failUnless(u2.get_readonly() is None) + self.failUnless(isinstance(u2.get_error(), CapConstraintError)) + +class Constraint(testutil.ReallyEqualMixin, unittest.TestCase): def test_constraint(self): good="http://127.0.0.1:3456/uri/URI%3ADIR2%3Agh3l5rbvnv2333mrfvalmjfr4i%3Alz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma/" uri.DirectoryURI.init_from_human_encoding(good) hunk ./src/allmydata/test/test_uri.py 257 fileURI = 'URI:CHK:gh3l5rbvnv2333mrfvalmjfr4i:lz6l7u3z3b7g37s4zkdmfpx5ly4ib4m6thrpbusi6ys62qtc6mma:3:10:345834' uri.CHKFileURI.init_from_string(fileURI) -class Mutable(unittest.TestCase): +class Mutable(testutil.ReallyEqualMixin, unittest.TestCase): def test_pack(self): writekey = "\x01" * 16 fingerprint = "\x02" * 32 hunk ./src/allmydata/test/test_uri.py 263 u = uri.WriteableSSKFileURI(writekey, fingerprint) - self.failUnlessEqual(u.writekey, writekey) - self.failUnlessEqual(u.fingerprint, fingerprint) + self.failUnlessReallyEqual(u.writekey, writekey) + self.failUnlessReallyEqual(u.fingerprint, fingerprint) self.failIf(u.is_readonly()) self.failUnless(u.is_mutable()) self.failUnless(IURI.providedBy(u)) hunk ./src/allmydata/test/test_uri.py 274 he = u.to_human_encoding() u_h = uri.WriteableSSKFileURI.init_from_human_encoding(he) - self.failUnlessEqual(u, u_h) + self.failUnlessReallyEqual(u, u_h) u2 = uri.from_string(u.to_string()) hunk ./src/allmydata/test/test_uri.py 277 - self.failUnlessEqual(u2.writekey, writekey) - self.failUnlessEqual(u2.fingerprint, fingerprint) + self.failUnlessReallyEqual(u2.writekey, writekey) + self.failUnlessReallyEqual(u2.fingerprint, fingerprint) self.failIf(u2.is_readonly()) self.failUnless(u2.is_mutable()) self.failUnless(IURI.providedBy(u2)) hunk ./src/allmydata/test/test_uri.py 294 u3 = u2.get_readonly() readkey = hashutil.ssk_readkey_hash(writekey) - self.failUnlessEqual(u3.fingerprint, fingerprint) - self.failUnlessEqual(u3.readkey, readkey) + self.failUnlessReallyEqual(u3.fingerprint, fingerprint) + self.failUnlessReallyEqual(u3.readkey, readkey) self.failUnless(u3.is_readonly()) self.failUnless(u3.is_mutable()) self.failUnless(IURI.providedBy(u3)) hunk ./src/allmydata/test/test_uri.py 305 u3i = uri.from_string(u3.to_string(), deep_immutable=True) self.failUnless(isinstance(u3i, uri.UnknownURI), u3i) u3ro = uri.from_string(uri.ALLEGED_READONLY_PREFIX + u3.to_string()) - self.failUnlessEqual(u3.to_string(), u3ro.to_string()) + self.failUnlessReallyEqual(u3.to_string(), u3ro.to_string()) u3imm = uri.from_string(uri.ALLEGED_IMMUTABLE_PREFIX + u3.to_string()) self.failUnless(isinstance(u3imm, uri.UnknownURI), u3imm) hunk ./src/allmydata/test/test_uri.py 311 he = u3.to_human_encoding() u3_h = uri.ReadonlySSKFileURI.init_from_human_encoding(he) - self.failUnlessEqual(u3, u3_h) + self.failUnlessReallyEqual(u3, u3_h) u4 = uri.ReadonlySSKFileURI(readkey, fingerprint) hunk ./src/allmydata/test/test_uri.py 314 - self.failUnlessEqual(u4.fingerprint, fingerprint) - self.failUnlessEqual(u4.readkey, readkey) + self.failUnlessReallyEqual(u4.fingerprint, fingerprint) + self.failUnlessReallyEqual(u4.readkey, readkey) self.failUnless(u4.is_readonly()) self.failUnless(u4.is_mutable()) self.failUnless(IURI.providedBy(u4)) hunk ./src/allmydata/test/test_uri.py 325 u4i = uri.from_string(u4.to_string(), deep_immutable=True) self.failUnless(isinstance(u4i, uri.UnknownURI), u4i) u4ro = uri.from_string(uri.ALLEGED_READONLY_PREFIX + u4.to_string()) - self.failUnlessEqual(u4.to_string(), u4ro.to_string()) + self.failUnlessReallyEqual(u4.to_string(), u4ro.to_string()) u4imm = uri.from_string(uri.ALLEGED_IMMUTABLE_PREFIX + u4.to_string()) self.failUnless(isinstance(u4imm, uri.UnknownURI), u4imm) hunk ./src/allmydata/test/test_uri.py 330 u4a = uri.from_string(u4.to_string()) - self.failUnlessEqual(u4a, u4) + self.failUnlessReallyEqual(u4a, u4) self.failUnless("ReadonlySSKFileURI" in str(u4a)) self.failUnlessIdentical(u4a.get_readonly(), u4a) hunk ./src/allmydata/test/test_uri.py 336 u5 = u4.get_verify_cap() self.failUnless(IVerifierURI.providedBy(u5)) - self.failUnlessEqual(u5.get_storage_index(), u.get_storage_index()) + self.failUnlessReallyEqual(u5.get_storage_index(), u.get_storage_index()) u7 = u.get_verify_cap() self.failUnless(IVerifierURI.providedBy(u7)) hunk ./src/allmydata/test/test_uri.py 339 - self.failUnlessEqual(u7.get_storage_index(), u.get_storage_index()) + self.failUnlessReallyEqual(u7.get_storage_index(), u.get_storage_index()) he = u5.to_human_encoding() u5_h = uri.SSKVerifierURI.init_from_human_encoding(he) hunk ./src/allmydata/test/test_uri.py 343 - self.failUnlessEqual(u5, u5_h) + self.failUnlessReallyEqual(u5, u5_h) hunk ./src/allmydata/test/test_uri.py 346 -class Dirnode(unittest.TestCase): +class Dirnode(testutil.ReallyEqualMixin, unittest.TestCase): def test_pack(self): writekey = "\x01" * 16 fingerprint = "\x02" * 32 hunk ./src/allmydata/test/test_uri.py 364 self.failIf(u1_filenode.is_readonly()) u2 = uri.from_string(u1.to_string()) - self.failUnlessEqual(u1.to_string(), u2.to_string()) + self.failUnlessReallyEqual(u1.to_string(), u2.to_string()) self.failIf(u2.is_readonly()) self.failUnless(u2.is_mutable()) self.failUnless(IURI.providedBy(u2)) hunk ./src/allmydata/test/test_uri.py 395 self.failUnlessIdentical(u3a, u3a.get_readonly()) u4 = uri.ReadonlyDirectoryURI(u2._filenode_uri.get_readonly()) - self.failUnlessEqual(u4.to_string(), u3.to_string()) + self.failUnlessReallyEqual(u4.to_string(), u3.to_string()) self.failUnless(u4.is_readonly()) self.failUnless(u4.is_mutable()) self.failUnless(IURI.providedBy(u4)) hunk ./src/allmydata/test/test_uri.py 412 ] for v in verifiers: self.failUnless(IVerifierURI.providedBy(v)) - self.failUnlessEqual(v._filenode_uri, + self.failUnlessReallyEqual(v._filenode_uri, u1.get_verify_cap()._filenode_uri) def test_immutable(self): hunk ./src/allmydata/test/test_uri.py 428 total_shares=total_shares, size=size) fncap = fnuri.to_string() - self.failUnlessEqual(fncap, "URI:CHK:aeaqcaibaeaqcaibaeaqcaibae:nf3nimquen7aeqm36ekgxomalstenpkvsdmf6fplj7swdatbv5oa:3:10:1234") + self.failUnlessReallyEqual(fncap, "URI:CHK:aeaqcaibaeaqcaibaeaqcaibae:nf3nimquen7aeqm36ekgxomalstenpkvsdmf6fplj7swdatbv5oa:3:10:1234") u1 = uri.ImmutableDirectoryURI(fnuri) self.failUnless(u1.is_readonly()) self.failIf(u1.is_mutable()) hunk ./src/allmydata/test/test_uri.py 439 u1_filenode = u1.get_filenode_cap() self.failIf(u1_filenode.is_mutable()) self.failUnless(u1_filenode.is_readonly()) - self.failUnlessEqual(u1_filenode.to_string(), fncap) + self.failUnlessReallyEqual(u1_filenode.to_string(), fncap) self.failUnless(str(u1)) u2 = uri.from_string(u1.to_string()) hunk ./src/allmydata/test/test_uri.py 443 - self.failUnlessEqual(u1.to_string(), u2.to_string()) + self.failUnlessReallyEqual(u1.to_string(), u2.to_string()) self.failUnless(u2.is_readonly()) self.failIf(u2.is_mutable()) self.failUnless(IURI.providedBy(u2)) hunk ./src/allmydata/test/test_uri.py 451 self.failUnless(IDirnodeURI.providedBy(u2)) u2i = uri.from_string(u1.to_string(), deep_immutable=True) - self.failUnlessEqual(u1.to_string(), u2i.to_string()) + self.failUnlessReallyEqual(u1.to_string(), u2i.to_string()) u3 = u2.get_readonly() hunk ./src/allmydata/test/test_uri.py 454 - self.failUnlessEqual(u3.to_string(), u2.to_string()) + self.failUnlessReallyEqual(u3.to_string(), u2.to_string()) self.failUnless(str(u3)) u3i = uri.from_string(u2.to_string(), deep_immutable=True) hunk ./src/allmydata/test/test_uri.py 458 - self.failUnlessEqual(u2.to_string(), u3i.to_string()) + self.failUnlessReallyEqual(u2.to_string(), u3i.to_string()) u2_verifier = u2.get_verify_cap() self.failUnless(isinstance(u2_verifier, hunk ./src/allmydata/test/test_uri.py 472 self.failUnless(IVerifierURI.providedBy(u2_verifier_fileuri)) u2vfs = u2_verifier_fileuri.to_string() # URI:CHK-Verifier:$key:$ueb:$k:$n:$size - self.failUnlessEqual(u2vfs, fnuri.get_verify_cap().to_string()) - self.failUnlessEqual(u2vs[len("URI:DIR2-"):], u2vfs[len("URI:"):]) + self.failUnlessReallyEqual(u2vfs, fnuri.get_verify_cap().to_string()) + self.failUnlessReallyEqual(u2vs[len("URI:DIR2-"):], u2vfs[len("URI:"):]) self.failUnless(str(u2_verifier)) def test_literal(self): hunk ./src/allmydata/test/test_uri.py 480 u0 = uri.LiteralFileURI("data") u1 = uri.LiteralDirectoryURI(u0) self.failUnless(str(u1)) - self.failUnlessEqual(u1.to_string(), "URI:DIR2-LIT:mrqxiyi") + self.failUnlessReallyEqual(u1.to_string(), "URI:DIR2-LIT:mrqxiyi") self.failUnless(u1.is_readonly()) self.failIf(u1.is_mutable()) self.failUnless(IURI.providedBy(u1)) hunk ./src/allmydata/test/test_uri.py 486 self.failIf(IFileURI.providedBy(u1)) self.failUnless(IDirnodeURI.providedBy(u1)) - self.failUnlessEqual(u1.get_verify_cap(), None) - self.failUnlessEqual(u1.get_storage_index(), None) - self.failUnlessEqual(u1.abbrev_si(), "") + self.failUnlessReallyEqual(u1.get_verify_cap(), None) + self.failUnlessReallyEqual(u1.get_storage_index(), None) + self.failUnlessReallyEqual(u1.abbrev_si(), "") hunk ./src/allmydata/test/test_web.py 1 + import os.path, re, urllib import simplejson from StringIO import StringIO hunk ./src/allmydata/test/test_web.py 39 timeout = 480 # Most of these take longer than 240 seconds on Francois's arm box. -unknown_rwcap = "lafs://from_the_future" -unknown_rocap = "ro.lafs://readonly_from_the_future" -unknown_immcap = "imm.lafs://immutable_from_the_future" +unknown_rwcap = u"lafs://from_the_future_rw_\u263A".encode('utf-8') +unknown_rocap = u"ro.lafs://readonly_from_the_future_ro_\u263A".encode('utf-8') +unknown_immcap = u"imm.lafs://immutable_from_the_future_imm_\u263A".encode('utf-8') class FakeStatsProvider: def get_stats(self): hunk ./src/allmydata/test/test_web.py 212 return self.s.stopService() def failUnlessIsBarDotTxt(self, res): - self.failUnlessEqual(res, self.BAR_CONTENTS, res) + self.failUnlessReallyEqual(res, self.BAR_CONTENTS, res) def failUnlessIsBarJSON(self, res): data = simplejson.loads(res) hunk ./src/allmydata/test/test_web.py 217 self.failUnless(isinstance(data, list)) - self.failUnlessEqual(data[0], u"filenode") + self.failUnlessReallyEqual(data[0], "filenode") self.failUnless(isinstance(data[1], dict)) self.failIf(data[1]["mutable"]) self.failIf("rw_uri" in data[1]) # immutable hunk ./src/allmydata/test/test_web.py 221 - self.failUnlessEqual(data[1]["ro_uri"], self._bar_txt_uri) - self.failUnlessEqual(data[1]["verify_uri"], self._bar_txt_verifycap) - self.failUnlessEqual(data[1]["size"], len(self.BAR_CONTENTS)) + self.failUnlessReallyEqual(data[1]["ro_uri"], self._bar_txt_uri) + self.failUnlessReallyEqual(data[1]["verify_uri"], self._bar_txt_verifycap) + self.failUnlessReallyEqual(data[1]["size"], len(self.BAR_CONTENTS)) def failUnlessIsFooJSON(self, res): data = simplejson.loads(res) hunk ./src/allmydata/test/test_web.py 228 self.failUnless(isinstance(data, list)) - self.failUnlessEqual(data[0], "dirnode", res) + self.failUnlessReallyEqual(data[0], "dirnode", res) self.failUnless(isinstance(data[1], dict)) self.failUnless(data[1]["mutable"]) self.failUnless("rw_uri" in data[1]) # mutable hunk ./src/allmydata/test/test_web.py 232 - self.failUnlessEqual(data[1]["rw_uri"], self._foo_uri) - self.failUnlessEqual(data[1]["ro_uri"], self._foo_readonly_uri) - self.failUnlessEqual(data[1]["verify_uri"], self._foo_verifycap) + self.failUnlessReallyEqual(data[1]["rw_uri"], self._foo_uri) + self.failUnlessReallyEqual(data[1]["ro_uri"], self._foo_readonly_uri) + self.failUnlessReallyEqual(data[1]["verify_uri"], self._foo_verifycap) kidnames = sorted([unicode(n) for n in data[1]["children"]]) hunk ./src/allmydata/test/test_web.py 237 - self.failUnlessEqual(kidnames, - [u"bar.txt", u"blockingfile", u"empty", - u"n\u00fc.txt", u"sub"]) + self.failUnlessReallyEqual(kidnames, + [u"bar.txt", u"blockingfile", u"empty", + u"n\u00fc.txt", u"sub"]) kids = dict( [(unicode(name),value) for (name,value) in data[1]["children"].iteritems()] ) hunk ./src/allmydata/test/test_web.py 243 - self.failUnlessEqual(kids[u"sub"][0], "dirnode") + self.failUnlessReallyEqual(kids[u"sub"][0], "dirnode") self.failUnlessIn("metadata", kids[u"sub"][1]) self.failUnlessIn("tahoe", kids[u"sub"][1]["metadata"]) tahoe_md = kids[u"sub"][1]["metadata"]["tahoe"] hunk ./src/allmydata/test/test_web.py 249 self.failUnlessIn("linkcrtime", tahoe_md) self.failUnlessIn("linkmotime", tahoe_md) - self.failUnlessEqual(kids[u"bar.txt"][0], "filenode") - self.failUnlessEqual(kids[u"bar.txt"][1]["size"], len(self.BAR_CONTENTS)) - 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.failUnlessReallyEqual(kids[u"bar.txt"][0], "filenode") + self.failUnlessReallyEqual(kids[u"bar.txt"][1]["size"], len(self.BAR_CONTENTS)) + self.failUnlessReallyEqual(kids[u"bar.txt"][1]["ro_uri"], self._bar_txt_uri) + self.failUnlessReallyEqual(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"]) hunk ./src/allmydata/test/test_web.py 256 - 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"], - self._bar_txt_uri) + self.failUnlessReallyEqual(kids[u"bar.txt"][1]["metadata"]["tahoe"]["linkcrtime"], + self._bar_txt_metadata["tahoe"]["linkcrtime"]) + self.failUnlessReallyEqual(kids[u"n\u00fc.txt"][1]["ro_uri"], + self._bar_txt_uri) def GET(self, urlpath, followRedirect=False, return_response=False, **kwargs): hunk ./src/allmydata/test/test_web.py 377 def should404(self, res, which): if isinstance(res, failure.Failure): res.trap(error.Error) - self.failUnlessEqual(res.value.status, "404") + self.failUnlessReallyEqual(res.value.status, "404") else: self.fail("%s was supposed to Error(404), not get '%s'" % (which, res)) hunk ./src/allmydata/test/test_web.py 385 def should302(self, res, which): if isinstance(res, failure.Failure): res.trap(error.Error) - self.failUnlessEqual(res.value.status, "302") + self.failUnlessReallyEqual(res.value.status, "302") else: self.fail("%s was supposed to Error(302), not get '%s'" % (which, res)) hunk ./src/allmydata/test/test_web.py 391 -class Web(WebMixin, WebErrorMixin, testutil.StallMixin, unittest.TestCase): +class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixin, unittest.TestCase): def test_create(self): pass hunk ./src/allmydata/test/test_web.py 538 def test_status_numbers(self): drrm = status.DownloadResultsRendererMixin() - self.failUnlessEqual(drrm.render_time(None, None), "") - self.failUnlessEqual(drrm.render_time(None, 2.5), "2.50s") - self.failUnlessEqual(drrm.render_time(None, 0.25), "250ms") - self.failUnlessEqual(drrm.render_time(None, 0.0021), "2.1ms") - self.failUnlessEqual(drrm.render_time(None, 0.000123), "123us") - self.failUnlessEqual(drrm.render_rate(None, None), "") - self.failUnlessEqual(drrm.render_rate(None, 2500000), "2.50MBps") - self.failUnlessEqual(drrm.render_rate(None, 30100), "30.1kBps") - self.failUnlessEqual(drrm.render_rate(None, 123), "123Bps") + self.failUnlessReallyEqual(drrm.render_time(None, None), "") + self.failUnlessReallyEqual(drrm.render_time(None, 2.5), "2.50s") + self.failUnlessReallyEqual(drrm.render_time(None, 0.25), "250ms") + self.failUnlessReallyEqual(drrm.render_time(None, 0.0021), "2.1ms") + self.failUnlessReallyEqual(drrm.render_time(None, 0.000123), "123us") + self.failUnlessReallyEqual(drrm.render_rate(None, None), "") + self.failUnlessReallyEqual(drrm.render_rate(None, 2500000), "2.50MBps") + self.failUnlessReallyEqual(drrm.render_rate(None, 30100), "30.1kBps") + self.failUnlessReallyEqual(drrm.render_rate(None, 123), "123Bps") urrm = status.UploadResultsRendererMixin() hunk ./src/allmydata/test/test_web.py 549 - self.failUnlessEqual(urrm.render_time(None, None), "") - self.failUnlessEqual(urrm.render_time(None, 2.5), "2.50s") - self.failUnlessEqual(urrm.render_time(None, 0.25), "250ms") - self.failUnlessEqual(urrm.render_time(None, 0.0021), "2.1ms") - self.failUnlessEqual(urrm.render_time(None, 0.000123), "123us") - self.failUnlessEqual(urrm.render_rate(None, None), "") - self.failUnlessEqual(urrm.render_rate(None, 2500000), "2.50MBps") - self.failUnlessEqual(urrm.render_rate(None, 30100), "30.1kBps") - self.failUnlessEqual(urrm.render_rate(None, 123), "123Bps") + self.failUnlessReallyEqual(urrm.render_time(None, None), "") + self.failUnlessReallyEqual(urrm.render_time(None, 2.5), "2.50s") + self.failUnlessReallyEqual(urrm.render_time(None, 0.25), "250ms") + self.failUnlessReallyEqual(urrm.render_time(None, 0.0021), "2.1ms") + self.failUnlessReallyEqual(urrm.render_time(None, 0.000123), "123us") + self.failUnlessReallyEqual(urrm.render_rate(None, None), "") + self.failUnlessReallyEqual(urrm.render_rate(None, 2500000), "2.50MBps") + self.failUnlessReallyEqual(urrm.render_rate(None, 30100), "30.1kBps") + self.failUnlessReallyEqual(urrm.render_rate(None, 123), "123Bps") def test_GET_FILEURL(self): d = self.GET(self.public_url + "/foo/bar.txt") hunk ./src/allmydata/test/test_web.py 569 d = self.GET(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 571 - self.failUnlessEqual(headers["content-range"][0], - "bytes 1-10/%d" % len(self.BAR_CONTENTS)) - self.failUnlessEqual(res, self.BAR_CONTENTS[1:11]) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes 1-10/%d" % len(self.BAR_CONTENTS)) + self.failUnlessReallyEqual(res, self.BAR_CONTENTS[1:11]) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 583 d = self.GET(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 585 - self.failUnlessEqual(headers["content-range"][0], - "bytes 5-%d/%d" % (length-1, length)) - self.failUnlessEqual(res, self.BAR_CONTENTS[5:]) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes 5-%d/%d" % (length-1, length)) + self.failUnlessReallyEqual(res, self.BAR_CONTENTS[5:]) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 597 d = self.GET(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 599 - self.failUnlessEqual(headers["content-range"][0], - "bytes %d-%d/%d" % (length-5, length-1, length)) - self.failUnlessEqual(res, self.BAR_CONTENTS[-5:]) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes %d-%d/%d" % (length-5, length-1, length)) + self.failUnlessReallyEqual(res, self.BAR_CONTENTS[-5:]) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 619 d = self.HEAD(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(res, "") - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(res, "") + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 622 - self.failUnlessEqual(headers["content-range"][0], - "bytes 1-10/%d" % len(self.BAR_CONTENTS)) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes 1-10/%d" % len(self.BAR_CONTENTS)) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 633 d = self.HEAD(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 635 - self.failUnlessEqual(headers["content-range"][0], - "bytes 5-%d/%d" % (length-1, length)) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes 5-%d/%d" % (length-1, length)) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 646 d = self.HEAD(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 206) + self.failUnlessReallyEqual(int(status), 206) self.failUnless(headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 648 - self.failUnlessEqual(headers["content-range"][0], - "bytes %d-%d/%d" % (length-5, length-1, length)) + self.failUnlessReallyEqual(headers["content-range"][0], + "bytes %d-%d/%d" % (length-5, length-1, length)) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 667 d = self.GET(self.public_url + "/foo/bar.txt", headers=headers, return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(int(status), 200) + self.failUnlessReallyEqual(int(status), 200) self.failUnless(not headers.has_key("content-range")) hunk ./src/allmydata/test/test_web.py 669 - self.failUnlessEqual(res, self.BAR_CONTENTS) + self.failUnlessReallyEqual(res, self.BAR_CONTENTS) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 676 def test_HEAD_FILEURL(self): d = self.HEAD(self.public_url + "/foo/bar.txt", return_response=True) def _got((res, status, headers)): - self.failUnlessEqual(res, "") - self.failUnlessEqual(headers["content-length"][0], - str(len(self.BAR_CONTENTS))) - self.failUnlessEqual(headers["content-type"], ["text/plain"]) + self.failUnlessReallyEqual(res, "") + self.failUnlessReallyEqual(headers["content-length"][0], + str(len(self.BAR_CONTENTS))) + self.failUnlessReallyEqual(headers["content-type"], ["text/plain"]) d.addCallback(_got) return d hunk ./src/allmydata/test/test_web.py 809 def test_PUT_NEWFILEURL(self): d = self.PUT(self.public_url + "/foo/new.txt", self.NEWFILE_CONTENTS) # TODO: we lose the response code, so we can't check this - #self.failUnlessEqual(responsecode, 201) + #self.failUnlessReallyEqual(responsecode, 201) d.addCallback(self.failUnlessURIMatchesROChild, self._foo_node, u"new.txt") d.addCallback(lambda res: self.failUnlessChildContentsAre(self._foo_node, u"new.txt", hunk ./src/allmydata/test/test_web.py 820 d = self.PUT(self.public_url + "/foo/new.txt?mutable=false", self.NEWFILE_CONTENTS) # TODO: we lose the response code, so we can't check this - #self.failUnlessEqual(responsecode, 201) + #self.failUnlessReallyEqual(responsecode, 201) d.addCallback(self.failUnlessURIMatchesROChild, self._foo_node, u"new.txt") d.addCallback(lambda res: self.failUnlessChildContentsAre(self._foo_node, u"new.txt", hunk ./src/allmydata/test/test_web.py 844 d = self.PUT(self.public_url + "/foo/new.txt?mutable=true", self.NEWFILE_CONTENTS) # TODO: we lose the response code, so we can't check this - #self.failUnlessEqual(responsecode, 201) + #self.failUnlessReallyEqual(responsecode, 201) def _check_uri(res): u = uri.from_string_mutable_filenode(res) self.failUnless(u.is_mutable()) hunk ./src/allmydata/test/test_web.py 870 def test_PUT_NEWFILEURL_replace(self): d = self.PUT(self.public_url + "/foo/bar.txt", self.NEWFILE_CONTENTS) # TODO: we lose the response code, so we can't check this - #self.failUnlessEqual(responsecode, 200) + #self.failUnlessReallyEqual(responsecode, 200) d.addCallback(self.failUnlessURIMatchesROChild, self._foo_node, u"bar.txt") d.addCallback(lambda res: self.failUnlessChildContentsAre(self._foo_node, u"bar.txt", hunk ./src/allmydata/test/test_web.py 943 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"]) + self.failUnlessReallyEqual(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 hunk ./src/allmydata/test/test_web.py 967 def test_GET_FILEURL_uri(self): d = self.GET(self.public_url + "/foo/bar.txt?t=uri") def _check(res): - self.failUnlessEqual(res, self._bar_txt_uri) + self.failUnlessReallyEqual(res, self._bar_txt_uri) d.addCallback(_check) d.addCallback(lambda res: self.GET(self.public_url + "/foo/bar.txt?t=readonly-uri")) hunk ./src/allmydata/test/test_web.py 973 def _check2(res): # for now, for files, uris and readonly-uris are the same - self.failUnlessEqual(res, self._bar_txt_uri) + self.failUnlessReallyEqual(res, self._bar_txt_uri) d.addCallback(_check2) return d hunk ./src/allmydata/test/test_web.py 1135 got = {} for (path_list, cap) in data: got[tuple(path_list)] = cap - self.failUnlessEqual(got[(u"sub",)], self._sub_uri) + self.failUnlessReallyEqual(got[(u"sub",)], self._sub_uri) self.failUnless((u"sub",u"baz.txt") in got) self.failUnless("finished" in res) self.failUnless("origin" in res) hunk ./src/allmydata/test/test_web.py 1159 d.addCallback(self.wait_for_operation, "126") d.addCallback(self.get_operation_results, "126", "json") def _got_json(data): - self.failUnlessEqual(data["finished"], True) + self.failUnlessReallyEqual(data["finished"], True) size = data["size"] self.failUnless(size > 1000) d.addCallback(_got_json) hunk ./src/allmydata/test/test_web.py 1200 "largest-immutable-file": 19, } for k,v in expected.iteritems(): - self.failUnlessEqual(stats[k], v, - "stats[%s] was %s, not %s" % - (k, stats[k], v)) - self.failUnlessEqual(stats["size-files-histogram"], - [ [11, 31, 3] ]) + self.failUnlessReallyEqual(stats[k], v, + "stats[%s] was %s, not %s" % + (k, stats[k], v)) + self.failUnlessReallyEqual(stats["size-files-histogram"], + [ [11, 31, 3] ]) d.addCallback(_got_json) return d hunk ./src/allmydata/test/test_web.py 1213 def _check(res): self.failUnless(res.endswith("\n")) units = [simplejson.loads(t) for t in res[:-1].split("\n")] - self.failUnlessEqual(len(units), 7) - self.failUnlessEqual(units[-1]["type"], "stats") + self.failUnlessReallyEqual(len(units), 7) + self.failUnlessReallyEqual(units[-1]["type"], "stats") first = units[0] hunk ./src/allmydata/test/test_web.py 1216 - self.failUnlessEqual(first["path"], []) - self.failUnlessEqual(first["cap"], self._foo_uri) - self.failUnlessEqual(first["type"], "directory") + self.failUnlessReallyEqual(first["path"], []) + self.failUnlessReallyEqual(first["cap"], self._foo_uri) + self.failUnlessReallyEqual(first["type"], "directory") baz = [u for u in units[:-1] if u["cap"] == self._baz_file_uri][0] hunk ./src/allmydata/test/test_web.py 1220 - self.failUnlessEqual(baz["path"], ["sub", "baz.txt"]) + self.failUnlessReallyEqual(baz["path"], ["sub", "baz.txt"]) self.failIfEqual(baz["storage-index"], None) self.failIfEqual(baz["verifycap"], None) self.failIfEqual(baz["repaircap"], None) hunk ./src/allmydata/test/test_web.py 1231 def test_GET_DIRURL_uri(self): d = self.GET(self.public_url + "/foo?t=uri") def _check(res): - self.failUnlessEqual(res, self._foo_uri) + self.failUnlessReallyEqual(res, self._foo_uri) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1238 def test_GET_DIRURL_readonly_uri(self): d = self.GET(self.public_url + "/foo?t=readonly-uri") def _check(res): - self.failUnlessEqual(res, self._foo_readonly_uri) + self.failUnlessReallyEqual(res, self._foo_readonly_uri) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1390 d = self.POST(url) def made_subsub(ssuri): d = self._foo_node.get_child_at_path(u"mkp/sub1/sub2") - d.addCallback(lambda ssnode: self.failUnlessEqual(ssnode.get_uri(), ssuri)) + d.addCallback(lambda ssnode: self.failUnlessReallyEqual(ssnode.get_uri(), ssuri)) d = self.POST(url) hunk ./src/allmydata/test/test_web.py 1392 - d.addCallback(lambda uri2: self.failUnlessEqual(uri2, ssuri)) + d.addCallback(lambda uri2: self.failUnlessReallyEqual(uri2, ssuri)) return d d.addCallback(made_subsub) return d hunk ./src/allmydata/test/test_web.py 1441 assert isinstance(k, unicode) d = node.list() def _check(children): - self.failUnlessEqual(sorted(children.keys()), sorted(expected_keys)) + self.failUnlessReallyEqual(sorted(children.keys()), sorted(expected_keys)) d.addCallback(_check) return d def failUnlessNodeHasChild(self, node, name): hunk ./src/allmydata/test/test_web.py 1464 d = node.get_child_at_path(name) d.addCallback(lambda node: download_to_data(node)) def _check(contents): - self.failUnlessEqual(contents, expected_contents) + self.failUnlessReallyEqual(contents, expected_contents) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1473 d = node.get_child_at_path(name) d.addCallback(lambda node: node.download_best_version()) def _check(contents): - self.failUnlessEqual(contents, expected_contents) + self.failUnlessReallyEqual(contents, expected_contents) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1482 d = node.get_child_at_path(name) def _check(child): self.failUnless(child.is_unknown() or not child.is_readonly()) - self.failUnlessEqual(child.get_uri(), expected_uri.strip()) - self.failUnlessEqual(child.get_write_uri(), expected_uri.strip()) + self.failUnlessReallyEqual(child.get_uri(), expected_uri.strip()) + self.failUnlessReallyEqual(child.get_write_uri(), expected_uri.strip()) expected_ro_uri = self._make_readonly(expected_uri) if expected_ro_uri: hunk ./src/allmydata/test/test_web.py 1486 - self.failUnlessEqual(child.get_readonly_uri(), expected_ro_uri.strip()) + self.failUnlessReallyEqual(child.get_readonly_uri(), expected_ro_uri.strip()) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1495 d = node.get_child_at_path(name) def _check(child): self.failUnless(child.is_unknown() or child.is_readonly()) - self.failUnlessEqual(child.get_write_uri(), None) - self.failUnlessEqual(child.get_uri(), expected_uri.strip()) - self.failUnlessEqual(child.get_readonly_uri(), expected_uri.strip()) + self.failUnlessReallyEqual(child.get_write_uri(), None) + self.failUnlessReallyEqual(child.get_uri(), expected_uri.strip()) + self.failUnlessReallyEqual(child.get_readonly_uri(), expected_uri.strip()) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1506 d = node.get_child_at_path(name) def _check(child): self.failUnless(child.is_unknown() or not child.is_readonly()) - self.failUnlessEqual(child.get_uri(), got_uri.strip()) - self.failUnlessEqual(child.get_write_uri(), got_uri.strip()) + self.failUnlessReallyEqual(child.get_uri(), got_uri.strip()) + self.failUnlessReallyEqual(child.get_write_uri(), got_uri.strip()) expected_ro_uri = self._make_readonly(got_uri) if expected_ro_uri: hunk ./src/allmydata/test/test_web.py 1510 - self.failUnlessEqual(child.get_readonly_uri(), expected_ro_uri.strip()) + self.failUnlessReallyEqual(child.get_readonly_uri(), expected_ro_uri.strip()) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1519 d = node.get_child_at_path(name) def _check(child): self.failUnless(child.is_unknown() or child.is_readonly()) - self.failUnlessEqual(child.get_write_uri(), None) - self.failUnlessEqual(got_uri.strip(), child.get_uri()) - self.failUnlessEqual(got_uri.strip(), child.get_readonly_uri()) + self.failUnlessReallyEqual(child.get_write_uri(), None) + self.failUnlessReallyEqual(got_uri.strip(), child.get_uri()) + self.failUnlessReallyEqual(got_uri.strip(), child.get_readonly_uri()) d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 1549 self.NEWFILE_CONTENTS)) target_url = self.public_url + "/foo/" + filename.encode("utf-8") d.addCallback(lambda res: self.GET(target_url)) - d.addCallback(lambda contents: self.failUnlessEqual(contents, - self.NEWFILE_CONTENTS, - contents)) + d.addCallback(lambda contents: self.failUnlessReallyEqual(contents, + self.NEWFILE_CONTENTS, + contents)) return d def test_POST_upload_unicode_named(self): hunk ./src/allmydata/test/test_web.py 1566 self.NEWFILE_CONTENTS)) target_url = self.public_url + "/foo/" + filename.encode("utf-8") d.addCallback(lambda res: self.GET(target_url)) - d.addCallback(lambda contents: self.failUnlessEqual(contents, - self.NEWFILE_CONTENTS, - contents)) + d.addCallback(lambda contents: self.failUnlessReallyEqual(contents, + self.NEWFILE_CONTENTS, + contents)) return d def test_POST_upload_no_link(self): hunk ./src/allmydata/test/test_web.py 1609 def test_POST_upload_no_link_whendone_results(self): def check(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) self.failUnless(target.startswith(self.webish_url), target) return client.getPage(target, method="GET") d = self.shouldRedirect2("test_POST_upload_no_link_whendone_results", hunk ./src/allmydata/test/test_web.py 1618 when_done="/uri/%(uri)s", file=("new.txt", self.NEWFILE_CONTENTS)) d.addCallback(lambda res: - self.failUnlessEqual(res, self.NEWFILE_CONTENTS)) + self.failUnlessReallyEqual(res, self.NEWFILE_CONTENTS)) return d def test_POST_upload_no_link_mutable(self): hunk ./src/allmydata/test/test_web.py 1634 return n.download_best_version() d.addCallback(_check) def _check2(data): - self.failUnlessEqual(data, self.NEWFILE_CONTENTS) + self.failUnlessReallyEqual(data, self.NEWFILE_CONTENTS) return self.GET("/uri/%s" % urllib.quote(self.filecap)) d.addCallback(_check2) def _check3(data): hunk ./src/allmydata/test/test_web.py 1638 - self.failUnlessEqual(data, self.NEWFILE_CONTENTS) + self.failUnlessReallyEqual(data, self.NEWFILE_CONTENTS) return self.GET("/file/%s" % urllib.quote(self.filecap)) d.addCallback(_check3) def _check4(data): hunk ./src/allmydata/test/test_web.py 1642 - self.failUnlessEqual(data, self.NEWFILE_CONTENTS) + self.failUnlessReallyEqual(data, self.NEWFILE_CONTENTS) d.addCallback(_check4) return d hunk ./src/allmydata/test/test_web.py 1690 self.failUnless(IMutableFileNode.providedBy(newnode)) self.failUnless(newnode.is_mutable()) self.failIf(newnode.is_readonly()) - self.failUnlessEqual(self._mutable_uri, newnode.get_uri()) + self.failUnlessReallyEqual(self._mutable_uri, newnode.get_uri()) d.addCallback(_got2) # upload a second time, using PUT instead of POST hunk ./src/allmydata/test/test_web.py 1719 self.failUnless(IMutableFileNode.providedBy(newnode)) self.failUnless(newnode.is_mutable()) self.failIf(newnode.is_readonly()) - self.failUnlessEqual(self._mutable_uri, newnode.get_uri()) + self.failUnlessReallyEqual(self._mutable_uri, newnode.get_uri()) d.addCallback(_got3) # look at the JSON form of the enclosing directory hunk ./src/allmydata/test/test_web.py 1728 followRedirect=True)) def _check_page_json(res): parsed = simplejson.loads(res) - self.failUnlessEqual(parsed[0], "dirnode") + self.failUnlessReallyEqual(parsed[0], "dirnode") children = dict( [(unicode(name),value) for (name,value) in parsed[1]["children"].iteritems()] ) hunk ./src/allmydata/test/test_web.py 1734 self.failUnless("new.txt" in children) new_json = children["new.txt"] - self.failUnlessEqual(new_json[0], "filenode") + self.failUnlessReallyEqual(new_json[0], "filenode") self.failUnless(new_json[1]["mutable"]) hunk ./src/allmydata/test/test_web.py 1736 - self.failUnlessEqual(new_json[1]["rw_uri"], self._mutable_uri) - ro_uri = unicode(self._mutable_node.get_readonly().to_string()) - self.failUnlessEqual(new_json[1]["ro_uri"], ro_uri) + self.failUnlessReallyEqual(new_json[1]["rw_uri"], self._mutable_uri) + ro_uri = self._mutable_node.get_readonly().to_string() + self.failUnlessReallyEqual(new_json[1]["ro_uri"], ro_uri) d.addCallback(_check_page_json) # and the JSON form of the file hunk ./src/allmydata/test/test_web.py 1746 self.GET(self.public_url + "/foo/new.txt?t=json")) def _check_file_json(res): parsed = simplejson.loads(res) - self.failUnlessEqual(parsed[0], "filenode") + self.failUnlessReallyEqual(parsed[0], "filenode") self.failUnless(parsed[1]["mutable"]) hunk ./src/allmydata/test/test_web.py 1748 - self.failUnlessEqual(parsed[1]["rw_uri"], self._mutable_uri) - ro_uri = unicode(self._mutable_node.get_readonly().to_string()) - self.failUnlessEqual(parsed[1]["ro_uri"], ro_uri) + self.failUnlessReallyEqual(parsed[1]["rw_uri"], self._mutable_uri) + ro_uri = self._mutable_node.get_readonly().to_string() + self.failUnlessReallyEqual(parsed[1]["ro_uri"], ro_uri) d.addCallback(_check_file_json) # and look at t=uri and t=readonly-uri hunk ./src/allmydata/test/test_web.py 1756 d.addCallback(lambda res: self.GET(self.public_url + "/foo/new.txt?t=uri")) - d.addCallback(lambda res: self.failUnlessEqual(res, self._mutable_uri)) + d.addCallback(lambda res: self.failUnlessReallyEqual(res, self._mutable_uri)) d.addCallback(lambda res: self.GET(self.public_url + "/foo/new.txt?t=readonly-uri")) def _check_ro_uri(res): hunk ./src/allmydata/test/test_web.py 1760 - ro_uri = unicode(self._mutable_node.get_readonly().to_string()) - self.failUnlessEqual(res, ro_uri) + ro_uri = self._mutable_node.get_readonly().to_string() + self.failUnlessReallyEqual(res, ro_uri) d.addCallback(_check_ro_uri) # make sure we can get to it from /uri/URI hunk ./src/allmydata/test/test_web.py 1768 d.addCallback(lambda res: self.GET("/uri/%s" % urllib.quote(self._mutable_uri))) d.addCallback(lambda res: - self.failUnlessEqual(res, NEW2_CONTENTS)) + self.failUnlessReallyEqual(res, NEW2_CONTENTS)) # and that HEAD computes the size correctly d.addCallback(lambda res: hunk ./src/allmydata/test/test_web.py 1775 self.HEAD(self.public_url + "/foo/new.txt", return_response=True)) def _got_headers((res, status, headers)): - self.failUnlessEqual(res, "") - self.failUnlessEqual(headers["content-length"][0], - str(len(NEW2_CONTENTS))) - self.failUnlessEqual(headers["content-type"], ["text/plain"]) + self.failUnlessReallyEqual(res, "") + self.failUnlessReallyEqual(headers["content-length"][0], + str(len(NEW2_CONTENTS))) + self.failUnlessReallyEqual(headers["content-type"], ["text/plain"]) d.addCallback(_got_headers) # make sure that size errors are displayed correctly for overwrite hunk ./src/allmydata/test/test_web.py 1836 d = self.POST(self.public_url + "/foo?replace=false", t="upload", file=("new.txt", self.NEWFILE_CONTENTS)) d.addCallback(lambda res: self.GET(self.public_url + "/foo/new.txt")) - d.addCallback(lambda res: self.failUnlessEqual(res, - self.NEWFILE_CONTENTS)) + d.addCallback(lambda res: self.failUnlessReallyEqual(res, + self.NEWFILE_CONTENTS)) return d def test_POST_upload_no_replace_queryarg(self): hunk ./src/allmydata/test/test_web.py 1907 d.addCallback(_check) redir_url = "http://allmydata.org/TARGET" def _check2(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) - self.failUnlessEqual(target, redir_url) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(target, redir_url) d.addCallback(lambda res: self.shouldRedirect2("test_POST_FILEURL_check", _check2, hunk ./src/allmydata/test/test_web.py 1941 d.addCallback(_check) redir_url = "http://allmydata.org/TARGET" def _check2(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) - self.failUnlessEqual(target, redir_url) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(target, redir_url) d.addCallback(lambda res: self.shouldRedirect2("test_POST_FILEURL_check_and_repair", _check2, hunk ./src/allmydata/test/test_web.py 1966 d.addCallback(_check) redir_url = "http://allmydata.org/TARGET" def _check2(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) - self.failUnlessEqual(target, redir_url) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(target, redir_url) d.addCallback(lambda res: self.shouldRedirect2("test_POST_DIRURL_check", _check2, hunk ./src/allmydata/test/test_web.py 2000 d.addCallback(_check) redir_url = "http://allmydata.org/TARGET" def _check2(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) - self.failUnlessEqual(target, redir_url) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(target, redir_url) d.addCallback(lambda res: self.shouldRedirect2("test_POST_DIRURL_check_and_repair", _check2, hunk ./src/allmydata/test/test_web.py 2054 def test_POST_DIRURL_deepcheck(self): def _check_redirect(statuscode, target): - self.failUnlessEqual(statuscode, str(http.FOUND)) + self.failUnlessReallyEqual(statuscode, str(http.FOUND)) self.failUnless(target.endswith("/operations/123")) d = self.shouldRedirect2("test_POST_DIRURL_deepcheck", _check_redirect, self.POST, self.public_url, hunk ./src/allmydata/test/test_web.py 2061 t="start-deep-check", ophandle="123") d.addCallback(self.wait_for_operation, "123") def _check_json(data): - self.failUnlessEqual(data["finished"], True) - self.failUnlessEqual(data["count-objects-checked"], 8) - self.failUnlessEqual(data["count-objects-healthy"], 8) + self.failUnlessReallyEqual(data["finished"], True) + self.failUnlessReallyEqual(data["count-objects-checked"], 8) + self.failUnlessReallyEqual(data["count-objects-healthy"], 8) d.addCallback(_check_json) d.addCallback(self.get_operation_results, "123", "html") def _check_html(res): hunk ./src/allmydata/test/test_web.py 2086 self.GET("/operations/123/%s?output=JSON" % foo_si_s)) def _check_foo_json(res): data = simplejson.loads(res) - self.failUnlessEqual(data["storage-index"], foo_si_s) + self.failUnlessReallyEqual(data["storage-index"], foo_si_s) self.failUnless(data["results"]["healthy"]) d.addCallback(_check_foo_json) return d hunk ./src/allmydata/test/test_web.py 2096 ophandle="124", output="json", followRedirect=True) d.addCallback(self.wait_for_operation, "124") def _check_json(data): - self.failUnlessEqual(data["finished"], True) - self.failUnlessEqual(data["count-objects-checked"], 8) - self.failUnlessEqual(data["count-objects-healthy-pre-repair"], 8) - self.failUnlessEqual(data["count-objects-unhealthy-pre-repair"], 0) - self.failUnlessEqual(data["count-corrupt-shares-pre-repair"], 0) - self.failUnlessEqual(data["count-repairs-attempted"], 0) - self.failUnlessEqual(data["count-repairs-successful"], 0) - self.failUnlessEqual(data["count-repairs-unsuccessful"], 0) - self.failUnlessEqual(data["count-objects-healthy-post-repair"], 8) - self.failUnlessEqual(data["count-objects-unhealthy-post-repair"], 0) - self.failUnlessEqual(data["count-corrupt-shares-post-repair"], 0) + self.failUnlessReallyEqual(data["finished"], True) + self.failUnlessReallyEqual(data["count-objects-checked"], 8) + self.failUnlessReallyEqual(data["count-objects-healthy-pre-repair"], 8) + self.failUnlessReallyEqual(data["count-objects-unhealthy-pre-repair"], 0) + self.failUnlessReallyEqual(data["count-corrupt-shares-pre-repair"], 0) + self.failUnlessReallyEqual(data["count-repairs-attempted"], 0) + self.failUnlessReallyEqual(data["count-repairs-successful"], 0) + self.failUnlessReallyEqual(data["count-repairs-unsuccessful"], 0) + self.failUnlessReallyEqual(data["count-objects-healthy-post-repair"], 8) + self.failUnlessReallyEqual(data["count-objects-unhealthy-post-repair"], 0) + self.failUnlessReallyEqual(data["count-corrupt-shares-post-repair"], 0) d.addCallback(_check_json) d.addCallback(self.get_operation_results, "124", "html") def _check_html(res): hunk ./src/allmydata/test/test_web.py 2641 def failUnlessIsEmptyJSON(self, res): data = simplejson.loads(res) - self.failUnlessEqual(data[0], "dirnode", data) - self.failUnlessEqual(len(data[1]["children"]), 0) + self.failUnlessReallyEqual(data[0], "dirnode", data) + self.failUnlessReallyEqual(len(data[1]["children"]), 0) def test_POST_rename_file_slash_fail(self): d = self.POST(self.public_url + "/foo", t="rename", hunk ./src/allmydata/test/test_web.py 2677 " actual page: %s" % (which, to_where, res)) res.trap(error.PageRedirect) if statuscode is not None: - self.failUnlessEqual(res.value.status, statuscode, - "%s: not a redirect" % which) + self.failUnlessReallyEqual(res.value.status, statuscode, + "%s: not a redirect" % which) if target is not None: # the PageRedirect does not seem to capture the uri= query arg # properly, so we can't check for it. hunk ./src/allmydata/test/test_web.py 2683 realtarget = self.webish_url + target - self.failUnlessEqual(res.value.location, realtarget, - "%s: wrong target" % which) + self.failUnlessReallyEqual(res.value.location, realtarget, + "%s: wrong target" % which) return res.value.location def test_GET_URI_form(self): hunk ./src/allmydata/test/test_web.py 2762 # replace /foo with a new (empty) directory d = self.PUT(self.public_url + "/foo?t=uri", new_uri) d.addCallback(lambda res: - self.failUnlessEqual(res.strip(), new_uri)) + self.failUnlessReallyEqual(res.strip(), new_uri)) d.addCallback(lambda res: self.failUnlessRWChildURIIs(self.public_root, u"foo", hunk ./src/allmydata/test/test_web.py 2803 def test_PUT_NEWFILEURL_uri(self): contents, n, new_uri = self.makefile(8) d = self.PUT(self.public_url + "/foo/new.txt?t=uri", new_uri) - d.addCallback(lambda res: self.failUnlessEqual(res.strip(), new_uri)) + d.addCallback(lambda res: self.failUnlessReallyEqual(res.strip(), new_uri)) d.addCallback(lambda res: self.failUnlessChildContentsAre(self._foo_node, u"new.txt", contents)) hunk ./src/allmydata/test/test_web.py 2812 def test_PUT_NEWFILEURL_uri_replace(self): contents, n, new_uri = self.makefile(8) d = self.PUT(self.public_url + "/foo/bar.txt?t=uri", new_uri) - d.addCallback(lambda res: self.failUnlessEqual(res.strip(), new_uri)) + d.addCallback(lambda res: self.failUnlessReallyEqual(res.strip(), new_uri)) d.addCallback(lambda res: self.failUnlessChildContentsAre(self._foo_node, u"bar.txt", contents)) hunk ./src/allmydata/test/test_web.py 2853 def _check(uri): assert isinstance(uri, str), uri self.failUnless(uri in FakeCHKFileNode.all_contents) - self.failUnlessEqual(FakeCHKFileNode.all_contents[uri], - file_contents) + self.failUnlessReallyEqual(FakeCHKFileNode.all_contents[uri], + file_contents) return self.GET("/uri/%s" % uri) d.addCallback(_check) def _check2(res): hunk ./src/allmydata/test/test_web.py 2858 - self.failUnlessEqual(res, file_contents) + self.failUnlessReallyEqual(res, file_contents) d.addCallback(_check2) return d hunk ./src/allmydata/test/test_web.py 2868 def _check(uri): assert isinstance(uri, str), uri self.failUnless(uri in FakeCHKFileNode.all_contents) - self.failUnlessEqual(FakeCHKFileNode.all_contents[uri], - file_contents) + self.failUnlessReallyEqual(FakeCHKFileNode.all_contents[uri], + file_contents) return self.GET("/uri/%s" % uri) d.addCallback(_check) def _check2(res): hunk ./src/allmydata/test/test_web.py 2873 - self.failUnlessEqual(res, file_contents) + self.failUnlessReallyEqual(res, file_contents) d.addCallback(_check2) return d hunk ./src/allmydata/test/test_web.py 2898 return n.download_best_version() d.addCallback(_check1) def _check2(data): - self.failUnlessEqual(data, file_contents) + self.failUnlessReallyEqual(data, file_contents) return self.GET("/uri/%s" % urllib.quote(self.filecap)) d.addCallback(_check2) def _check3(res): hunk ./src/allmydata/test/test_web.py 2902 - self.failUnlessEqual(res, file_contents) + self.failUnlessReallyEqual(res, file_contents) d.addCallback(_check3) return d hunk ./src/allmydata/test/test_web.py 3105 d = self.GET("/static/subdir/hello.txt") def _check(res): - self.failUnlessEqual(res, "hello") + self.failUnlessReallyEqual(res, "hello") d.addCallback(_check) return d hunk ./src/allmydata/test/test_web.py 3110 -class Util(unittest.TestCase, ShouldFailMixin): +class Util(ShouldFailMixin, testutil.ReallyEqualMixin, unittest.TestCase): def test_load_file(self): # This will raise an exception unless a well-formed XML file is found under that name. common.getxmlfile('directory.xhtml').load() hunk ./src/allmydata/test/test_web.py 3116 def test_parse_replace_arg(self): - self.failUnlessEqual(common.parse_replace_arg("true"), True) - self.failUnlessEqual(common.parse_replace_arg("false"), False) - self.failUnlessEqual(common.parse_replace_arg("only-files"), - "only-files") + self.failUnlessReallyEqual(common.parse_replace_arg("true"), True) + self.failUnlessReallyEqual(common.parse_replace_arg("false"), False) + self.failUnlessReallyEqual(common.parse_replace_arg("only-files"), + "only-files") self.shouldFail(AssertionError, "test_parse_replace_arg", "", common.parse_replace_arg, "only_fles") hunk ./src/allmydata/test/test_web.py 3124 def test_abbreviate_time(self): - self.failUnlessEqual(common.abbreviate_time(None), "") - self.failUnlessEqual(common.abbreviate_time(1.234), "1.23s") - self.failUnlessEqual(common.abbreviate_time(0.123), "123ms") - self.failUnlessEqual(common.abbreviate_time(0.00123), "1.2ms") - self.failUnlessEqual(common.abbreviate_time(0.000123), "123us") + self.failUnlessReallyEqual(common.abbreviate_time(None), "") + self.failUnlessReallyEqual(common.abbreviate_time(1.234), "1.23s") + self.failUnlessReallyEqual(common.abbreviate_time(0.123), "123ms") + self.failUnlessReallyEqual(common.abbreviate_time(0.00123), "1.2ms") + self.failUnlessReallyEqual(common.abbreviate_time(0.000123), "123us") def test_abbreviate_rate(self): hunk ./src/allmydata/test/test_web.py 3131 - self.failUnlessEqual(common.abbreviate_rate(None), "") - self.failUnlessEqual(common.abbreviate_rate(1234000), "1.23MBps") - self.failUnlessEqual(common.abbreviate_rate(12340), "12.3kBps") - self.failUnlessEqual(common.abbreviate_rate(123), "123Bps") + self.failUnlessReallyEqual(common.abbreviate_rate(None), "") + self.failUnlessReallyEqual(common.abbreviate_rate(1234000), "1.23MBps") + self.failUnlessReallyEqual(common.abbreviate_rate(12340), "12.3kBps") + self.failUnlessReallyEqual(common.abbreviate_rate(123), "123Bps") def test_abbreviate_size(self): hunk ./src/allmydata/test/test_web.py 3137 - self.failUnlessEqual(common.abbreviate_size(None), "") - self.failUnlessEqual(common.abbreviate_size(1.23*1000*1000*1000), "1.23GB") - self.failUnlessEqual(common.abbreviate_size(1.23*1000*1000), "1.23MB") - self.failUnlessEqual(common.abbreviate_size(1230), "1.2kB") - self.failUnlessEqual(common.abbreviate_size(123), "123B") + self.failUnlessReallyEqual(common.abbreviate_size(None), "") + self.failUnlessReallyEqual(common.abbreviate_size(1.23*1000*1000*1000), "1.23GB") + self.failUnlessReallyEqual(common.abbreviate_size(1.23*1000*1000), "1.23MB") + self.failUnlessReallyEqual(common.abbreviate_size(1230), "1.2kB") + self.failUnlessReallyEqual(common.abbreviate_size(123), "123B") def test_plural(self): def convert(s): hunk ./src/allmydata/test/test_web.py 3146 return "%d second%s" % (s, status.plural(s)) - self.failUnlessEqual(convert(0), "0 seconds") - self.failUnlessEqual(convert(1), "1 second") - self.failUnlessEqual(convert(2), "2 seconds") + self.failUnlessReallyEqual(convert(0), "0 seconds") + self.failUnlessReallyEqual(convert(1), "1 second") + self.failUnlessReallyEqual(convert(2), "2 seconds") def convert2(s): return "has share%s: %s" % (status.plural(s), ",".join(s)) hunk ./src/allmydata/test/test_web.py 3151 - self.failUnlessEqual(convert2([]), "has shares: ") - self.failUnlessEqual(convert2(["1"]), "has share: 1") - self.failUnlessEqual(convert2(["1","2"]), "has shares: 1,2") + self.failUnlessReallyEqual(convert2([]), "has shares: ") + self.failUnlessReallyEqual(convert2(["1"]), "has share: 1") + self.failUnlessReallyEqual(convert2(["1","2"]), "has shares: 1,2") hunk ./src/allmydata/test/test_web.py 3156 -class Grid(GridTestMixin, WebErrorMixin, unittest.TestCase, ShouldFailMixin): +class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMixin, unittest.TestCase): def CHECK(self, ign, which, args, clientnum=0): fileurl = self.fileurls[which] hunk ./src/allmydata/test/test_web.py 3198 def _clobber_shares(ignored): good_shares = self.find_shares(self.uris["good"]) - self.failUnlessEqual(len(good_shares), 10) + self.failUnlessReallyEqual(len(good_shares), 10) sick_shares = self.find_shares(self.uris["sick"]) os.unlink(sick_shares[0][2]) dead_shares = self.find_shares(self.uris["dead"]) hunk ./src/allmydata/test/test_web.py 3226 d.addCallback(self.CHECK, "good", "t=check&output=json") def _got_json_good(res): r = simplejson.loads(res) - self.failUnlessEqual(r["summary"], "Healthy") + self.failUnlessReallyEqual(r["summary"], "Healthy") self.failUnless(r["results"]["healthy"]) self.failIf(r["results"]["needs-rebalancing"]) self.failUnless(r["results"]["recoverable"]) hunk ./src/allmydata/test/test_web.py 3247 d.addCallback(self.CHECK, "small", "t=check&output=json") def _got_json_small(res): r = simplejson.loads(res) - self.failUnlessEqual(r["storage-index"], "") + self.failUnlessReallyEqual(r["storage-index"], "") self.failUnless(r["results"]["healthy"]) d.addCallback(_got_json_small) hunk ./src/allmydata/test/test_web.py 3259 d.addCallback(self.CHECK, "smalldir", "t=check&output=json") def _got_json_smalldir(res): r = simplejson.loads(res) - self.failUnlessEqual(r["storage-index"], "") + self.failUnlessReallyEqual(r["storage-index"], "") self.failUnless(r["results"]["healthy"]) d.addCallback(_got_json_smalldir) hunk ./src/allmydata/test/test_web.py 3270 d.addCallback(self.CHECK, "sick", "t=check&output=json") def _got_json_sick(res): r = simplejson.loads(res) - self.failUnlessEqual(r["summary"], - "Not Healthy: 9 shares (enc 3-of-10)") + self.failUnlessReallyEqual(r["summary"], + "Not Healthy: 9 shares (enc 3-of-10)") self.failIf(r["results"]["healthy"]) self.failIf(r["results"]["needs-rebalancing"]) self.failUnless(r["results"]["recoverable"]) hunk ./src/allmydata/test/test_web.py 3284 d.addCallback(self.CHECK, "dead", "t=check&output=json") def _got_json_dead(res): r = simplejson.loads(res) - self.failUnlessEqual(r["summary"], - "Not Healthy: 1 shares (enc 3-of-10)") + self.failUnlessReallyEqual(r["summary"], + "Not Healthy: 1 shares (enc 3-of-10)") self.failIf(r["results"]["healthy"]) self.failIf(r["results"]["needs-rebalancing"]) self.failIf(r["results"]["recoverable"]) hunk ./src/allmydata/test/test_web.py 3302 r["summary"]) self.failIf(r["results"]["healthy"]) self.failUnless(r["results"]["recoverable"]) - self.failUnlessEqual(r["results"]["count-shares-good"], 9) - self.failUnlessEqual(r["results"]["count-corrupt-shares"], 1) + self.failUnlessReallyEqual(r["results"]["count-shares-good"], 9) + self.failUnlessReallyEqual(r["results"]["count-corrupt-shares"], 1) d.addCallback(_got_json_corrupt) d.addErrback(self.explain_web_error) hunk ./src/allmydata/test/test_web.py 3339 def _clobber_shares(ignored): good_shares = self.find_shares(self.uris["good"]) - self.failUnlessEqual(len(good_shares), 10) + self.failUnlessReallyEqual(len(good_shares), 10) sick_shares = self.find_shares(self.uris["sick"]) os.unlink(sick_shares[0][2]) dead_shares = self.find_shares(self.uris["dead"]) hunk ./src/allmydata/test/test_web.py 3413 d.addCallback(self.CHECK, "sick", "t=check&repair=true&output=json") def _got_json_sick(res): r = simplejson.loads(res) - self.failUnlessEqual(r["repair-attempted"], True) - self.failUnlessEqual(r["repair-successful"], True) - self.failUnlessEqual(r["pre-repair-results"]["summary"], - "Not Healthy: 9 shares (enc 3-of-10)") + self.failUnlessReallyEqual(r["repair-attempted"], True) + self.failUnlessReallyEqual(r["repair-successful"], True) + self.failUnlessReallyEqual(r["pre-repair-results"]["summary"], + "Not Healthy: 9 shares (enc 3-of-10)") self.failIf(r["pre-repair-results"]["results"]["healthy"]) hunk ./src/allmydata/test/test_web.py 3418 - self.failUnlessEqual(r["post-repair-results"]["summary"], "healthy") + self.failUnlessReallyEqual(r["post-repair-results"]["summary"], "healthy") self.failUnless(r["post-repair-results"]["results"]["healthy"]) d.addCallback(_got_json_sick) hunk ./src/allmydata/test/test_web.py 3466 # find the More Info link for name, should be relative mo = re.search(r'More Info', res) info_url = mo.group(1) - self.failUnlessEqual(info_url, "%s?t=info" % (str(name),)) + self.failUnlessReallyEqual(info_url, "%s?t=info" % (str(name),)) if immutable: d.addCallback(_check_directory_html, "-IMM") else: hunk ./src/allmydata/test/test_web.py 3475 d.addCallback(lambda ign: self.GET(self.rooturl+"?t=json")) def _check_directory_json(res, expect_rw_uri): data = simplejson.loads(res) - self.failUnlessEqual(data[0], "dirnode") + self.failUnlessReallyEqual(data[0], "dirnode") f = data[1]["children"][name] hunk ./src/allmydata/test/test_web.py 3477 - self.failUnlessEqual(f[0], "unknown") + self.failUnlessReallyEqual(f[0], "unknown") if expect_rw_uri: hunk ./src/allmydata/test/test_web.py 3479 - self.failUnlessEqual(f[1]["rw_uri"], unknown_rwcap) + self.failUnlessReallyEqual(f[1]["rw_uri"], unknown_rwcap.decode('utf-8')) else: self.failIfIn("rw_uri", f[1]) if immutable: hunk ./src/allmydata/test/test_web.py 3483 - self.failUnlessEqual(f[1]["ro_uri"], unknown_immcap, data) + self.failUnlessReallyEqual(f[1]["ro_uri"], unknown_immcap.decode('utf-8'), data) else: hunk ./src/allmydata/test/test_web.py 3485 - self.failUnlessEqual(f[1]["ro_uri"], unknown_rocap) + self.failUnlessReallyEqual(f[1]["ro_uri"], unknown_rocap.decode('utf-8')) self.failUnless("metadata" in f[1]) d.addCallback(_check_directory_json, expect_rw_uri=not immutable) hunk ./src/allmydata/test/test_web.py 3516 def _check_json(res, expect_rw_uri): data = simplejson.loads(res) - self.failUnlessEqual(data[0], "unknown") + self.failUnlessReallyEqual(data[0], "unknown") if expect_rw_uri: hunk ./src/allmydata/test/test_web.py 3518 - self.failUnlessEqual(data[1]["rw_uri"], unknown_rwcap) + self.failUnlessReallyEqual(data[1]["rw_uri"], unknown_rwcap.decode('utf-8')) else: self.failIfIn("rw_uri", data[1]) hunk ./src/allmydata/test/test_web.py 3523 if immutable: - self.failUnlessEqual(data[1]["ro_uri"], unknown_immcap) - self.failUnlessEqual(data[1]["mutable"], False) + self.failUnlessReallyEqual(data[1]["ro_uri"], unknown_immcap.decode('utf-8')) + self.failUnlessReallyEqual(data[1]["mutable"], False) elif expect_rw_uri: hunk ./src/allmydata/test/test_web.py 3526 - self.failUnlessEqual(data[1]["ro_uri"], unknown_rocap) - self.failUnlessEqual(data[1]["mutable"], True) + self.failUnlessReallyEqual(data[1]["ro_uri"], unknown_rocap.decode('utf-8')) + self.failUnlessReallyEqual(data[1]["mutable"], True) else: hunk ./src/allmydata/test/test_web.py 3529 - self.failUnlessEqual(data[1]["ro_uri"], unknown_rocap) + self.failUnlessReallyEqual(data[1]["ro_uri"], unknown_rocap.decode('utf-8')) self.failIf("mutable" in data[1], data[1]) # TODO: check metadata contents hunk ./src/allmydata/test/test_web.py 3636 self.failUnless(rwcapdata == "") self.failUnless(name in kids) (expected_child, ign) = kids[name] - self.failUnlessEqual(ro_uri, expected_child.get_readonly_uri()) + self.failUnlessReallyEqual(ro_uri, expected_child.get_readonly_uri()) numkids += 1 hunk ./src/allmydata/test/test_web.py 3639 - self.failUnlessEqual(numkids, 3) + self.failUnlessReallyEqual(numkids, 3) return self.rootnode.list() d.addCallback(_check_data) hunk ./src/allmydata/test/test_web.py 3645 # Now when we use the real directory listing code, the mutants should be absent. def _check_kids(children): - self.failUnlessEqual(sorted(children.keys()), [u"lonely"]) + self.failUnlessReallyEqual(sorted(children.keys()), [u"lonely"]) lonely_node, lonely_metadata = children[u"lonely"] hunk ./src/allmydata/test/test_web.py 3648 - self.failUnlessEqual(lonely_node.get_write_uri(), None) - self.failUnlessEqual(lonely_node.get_readonly_uri(), lonely_uri) + self.failUnlessReallyEqual(lonely_node.get_write_uri(), None) + self.failUnlessReallyEqual(lonely_node.get_readonly_uri(), lonely_uri) d.addCallback(_check_kids) d.addCallback(lambda ign: nm.create_from_cap(self.cap.to_string())) hunk ./src/allmydata/test/test_web.py 3678 d.addCallback(lambda ign: self.GET(self.rooturl+"?t=json")) def _check_json(res): data = simplejson.loads(res) - self.failUnlessEqual(data[0], "dirnode") + self.failUnlessReallyEqual(data[0], "dirnode") listed_children = data[1]["children"] hunk ./src/allmydata/test/test_web.py 3680 - self.failUnlessEqual(sorted(listed_children.keys()), [u"lonely"]) + self.failUnlessReallyEqual(sorted(listed_children.keys()), [u"lonely"]) ll_type, ll_data = listed_children[u"lonely"] hunk ./src/allmydata/test/test_web.py 3682 - self.failUnlessEqual(ll_type, "filenode") + self.failUnlessReallyEqual(ll_type, "filenode") self.failIf("rw_uri" in ll_data) hunk ./src/allmydata/test/test_web.py 3684 - self.failUnlessEqual(ll_data["ro_uri"], lonely_uri) + self.failUnlessReallyEqual(ll_data["ro_uri"], lonely_uri) d.addCallback(_check_json) return d hunk ./src/allmydata/test/test_web.py 3741 print "response is:", res print "undecodeable line was '%s'" % line raise - self.failUnlessEqual(len(units), 5+1) + self.failUnlessReallyEqual(len(units), 5+1) # should be parent-first u0 = units[0] hunk ./src/allmydata/test/test_web.py 3744 - self.failUnlessEqual(u0["path"], []) - self.failUnlessEqual(u0["type"], "directory") - self.failUnlessEqual(u0["cap"], self.rootnode.get_uri()) + self.failUnlessReallyEqual(u0["path"], []) + self.failUnlessReallyEqual(u0["type"], "directory") + self.failUnlessReallyEqual(u0["cap"], self.rootnode.get_uri()) u0cr = u0["check-results"] hunk ./src/allmydata/test/test_web.py 3748 - self.failUnlessEqual(u0cr["results"]["count-shares-good"], 10) + self.failUnlessReallyEqual(u0cr["results"]["count-shares-good"], 10) ugood = [u for u in units if u["type"] == "file" and u["path"] == [u"good"]][0] hunk ./src/allmydata/test/test_web.py 3752 - self.failUnlessEqual(ugood["cap"], self.uris["good"]) + self.failUnlessReallyEqual(ugood["cap"], self.uris["good"]) ugoodcr = ugood["check-results"] hunk ./src/allmydata/test/test_web.py 3754 - self.failUnlessEqual(ugoodcr["results"]["count-shares-good"], 10) + self.failUnlessReallyEqual(ugoodcr["results"]["count-shares-good"], 10) stats = units[-1] hunk ./src/allmydata/test/test_web.py 3757 - self.failUnlessEqual(stats["type"], "stats") + self.failUnlessReallyEqual(stats["type"], "stats") s = stats["stats"] hunk ./src/allmydata/test/test_web.py 3759 - self.failUnlessEqual(s["count-immutable-files"], 2) - self.failUnlessEqual(s["count-literal-files"], 1) - self.failUnlessEqual(s["count-directories"], 1) - self.failUnlessEqual(s["count-unknown"], 1) + self.failUnlessReallyEqual(s["count-immutable-files"], 2) + self.failUnlessReallyEqual(s["count-literal-files"], 1) + self.failUnlessReallyEqual(s["count-directories"], 1) + self.failUnlessReallyEqual(s["count-unknown"], 1) d.addCallback(_done) d.addCallback(self.CHECK, "root", "t=stream-manifest") hunk ./src/allmydata/test/test_web.py 3769 def _check_manifest(res): self.failUnless(res.endswith("\n")) units = [simplejson.loads(t) for t in res[:-1].split("\n")] - self.failUnlessEqual(len(units), 5+1) - self.failUnlessEqual(units[-1]["type"], "stats") + self.failUnlessReallyEqual(len(units), 5+1) + self.failUnlessReallyEqual(units[-1]["type"], "stats") first = units[0] hunk ./src/allmydata/test/test_web.py 3772 - self.failUnlessEqual(first["path"], []) - self.failUnlessEqual(first["cap"], self.rootnode.get_uri()) - self.failUnlessEqual(first["type"], "directory") + self.failUnlessReallyEqual(first["path"], []) + self.failUnlessReallyEqual(first["cap"], self.rootnode.get_uri()) + self.failUnlessReallyEqual(first["type"], "directory") stats = units[-1]["stats"] hunk ./src/allmydata/test/test_web.py 3776 - self.failUnlessEqual(stats["count-immutable-files"], 2) - self.failUnlessEqual(stats["count-literal-files"], 1) - self.failUnlessEqual(stats["count-mutable-files"], 0) - self.failUnlessEqual(stats["count-immutable-files"], 2) - self.failUnlessEqual(stats["count-unknown"], 1) + self.failUnlessReallyEqual(stats["count-immutable-files"], 2) + self.failUnlessReallyEqual(stats["count-literal-files"], 1) + self.failUnlessReallyEqual(stats["count-mutable-files"], 0) + self.failUnlessReallyEqual(stats["count-immutable-files"], 2) + self.failUnlessReallyEqual(stats["count-unknown"], 1) d.addCallback(_check_manifest) # now add root/subdir and root/subdir/grandchild, then make subdir hunk ./src/allmydata/test/test_web.py 3826 error_line) self.failUnless(len(error_msg) > 2, error_msg_s) # some traceback units = [simplejson.loads(line) for line in lines[:first_error]] - self.failUnlessEqual(len(units), 6) # includes subdir + self.failUnlessReallyEqual(len(units), 6) # includes subdir last_unit = units[-1] hunk ./src/allmydata/test/test_web.py 3828 - self.failUnlessEqual(last_unit["path"], ["subdir"]) + self.failUnlessReallyEqual(last_unit["path"], ["subdir"]) d.addCallback(_check_broken_manifest) d.addCallback(self.CHECK, "root", "t=stream-deep-check") hunk ./src/allmydata/test/test_web.py 3847 error_line) self.failUnless(len(error_msg) > 2, error_msg_s) # some traceback units = [simplejson.loads(line) for line in lines[:first_error]] - self.failUnlessEqual(len(units), 6) # includes subdir + self.failUnlessReallyEqual(len(units), 6) # includes subdir last_unit = units[-1] hunk ./src/allmydata/test/test_web.py 3849 - self.failUnlessEqual(last_unit["path"], ["subdir"]) + self.failUnlessReallyEqual(last_unit["path"], ["subdir"]) r = last_unit["check-results"]["results"] hunk ./src/allmydata/test/test_web.py 3851 - self.failUnlessEqual(r["count-recoverable-versions"], 0) - self.failUnlessEqual(r["count-shares-good"], 1) - self.failUnlessEqual(r["recoverable"], False) + self.failUnlessReallyEqual(r["count-recoverable-versions"], 0) + self.failUnlessReallyEqual(r["count-shares-good"], 1) + self.failUnlessReallyEqual(r["recoverable"], False) d.addCallback(_check_broken_deepcheck) d.addErrback(self.explain_web_error) hunk ./src/allmydata/test/test_web.py 3897 def _clobber_shares(ignored): good_shares = self.find_shares(self.uris["good"]) - self.failUnlessEqual(len(good_shares), 10) + self.failUnlessReallyEqual(len(good_shares), 10) sick_shares = self.find_shares(self.uris["sick"]) os.unlink(sick_shares[0][2]) #dead_shares = self.find_shares(self.uris["dead"]) hunk ./src/allmydata/test/test_web.py 3921 units = [simplejson.loads(line) for line in res.splitlines() if line] - self.failUnlessEqual(len(units), 4+1) + self.failUnlessReallyEqual(len(units), 4+1) # should be parent-first u0 = units[0] hunk ./src/allmydata/test/test_web.py 3924 - self.failUnlessEqual(u0["path"], []) - self.failUnlessEqual(u0["type"], "directory") - self.failUnlessEqual(u0["cap"], self.rootnode.get_uri()) + self.failUnlessReallyEqual(u0["path"], []) + self.failUnlessReallyEqual(u0["type"], "directory") + self.failUnlessReallyEqual(u0["cap"], self.rootnode.get_uri()) u0crr = u0["check-and-repair-results"] hunk ./src/allmydata/test/test_web.py 3928 - self.failUnlessEqual(u0crr["repair-attempted"], False) - self.failUnlessEqual(u0crr["pre-repair-results"]["results"]["count-shares-good"], 10) + self.failUnlessReallyEqual(u0crr["repair-attempted"], False) + self.failUnlessReallyEqual(u0crr["pre-repair-results"]["results"]["count-shares-good"], 10) ugood = [u for u in units if u["type"] == "file" and u["path"] == [u"good"]][0] hunk ./src/allmydata/test/test_web.py 3933 - self.failUnlessEqual(ugood["cap"], self.uris["good"]) + self.failUnlessReallyEqual(ugood["cap"], self.uris["good"]) ugoodcrr = ugood["check-and-repair-results"] hunk ./src/allmydata/test/test_web.py 3935 - self.failUnlessEqual(ugoodcrr["repair-attempted"], False) - self.failUnlessEqual(ugoodcrr["pre-repair-results"]["results"]["count-shares-good"], 10) + self.failUnlessReallyEqual(ugoodcrr["repair-attempted"], False) + self.failUnlessReallyEqual(ugoodcrr["pre-repair-results"]["results"]["count-shares-good"], 10) usick = [u for u in units if u["type"] == "file" and u["path"] == [u"sick"]][0] hunk ./src/allmydata/test/test_web.py 3940 - self.failUnlessEqual(usick["cap"], self.uris["sick"]) + self.failUnlessReallyEqual(usick["cap"], self.uris["sick"]) usickcrr = usick["check-and-repair-results"] hunk ./src/allmydata/test/test_web.py 3942 - self.failUnlessEqual(usickcrr["repair-attempted"], True) - self.failUnlessEqual(usickcrr["repair-successful"], True) - self.failUnlessEqual(usickcrr["pre-repair-results"]["results"]["count-shares-good"], 9) - self.failUnlessEqual(usickcrr["post-repair-results"]["results"]["count-shares-good"], 10) + self.failUnlessReallyEqual(usickcrr["repair-attempted"], True) + self.failUnlessReallyEqual(usickcrr["repair-successful"], True) + self.failUnlessReallyEqual(usickcrr["pre-repair-results"]["results"]["count-shares-good"], 9) + self.failUnlessReallyEqual(usickcrr["post-repair-results"]["results"]["count-shares-good"], 10) stats = units[-1] hunk ./src/allmydata/test/test_web.py 3948 - self.failUnlessEqual(stats["type"], "stats") + self.failUnlessReallyEqual(stats["type"], "stats") s = stats["stats"] hunk ./src/allmydata/test/test_web.py 3950 - self.failUnlessEqual(s["count-immutable-files"], 2) - self.failUnlessEqual(s["count-literal-files"], 1) - self.failUnlessEqual(s["count-directories"], 1) + self.failUnlessReallyEqual(s["count-immutable-files"], 2) + self.failUnlessReallyEqual(s["count-literal-files"], 1) + self.failUnlessReallyEqual(s["count-directories"], 1) d.addCallback(_done) d.addErrback(self.explain_web_error) hunk ./src/allmydata/test/test_web.py 4099 for line in res.splitlines() if line] # root, one, small, mutable, stats - self.failUnlessEqual(len(units), 4+1) + self.failUnlessReallyEqual(len(units), 4+1) d.addCallback(_done) d.addCallback(self._count_leases, "root") hunk ./src/allmydata/test/test_web.py 4189 "severe corruption. You should perform a filecheck on " "this object to learn more. The full error message is: " "Failed to get enough shareholders: have 0, need 3") - self.failUnlessEqual(exp, body) + self.failUnlessReallyEqual(exp, body) d.addCallback(_check_zero_shares) hunk ./src/allmydata/test/test_web.py 4206 "corruption. You should perform a filecheck on " "this object to learn more. The full error message is:" " Failed to get enough shareholders: have 1, need 3") - self.failUnlessEqual(exp, body) + self.failUnlessReallyEqual(exp, body) d.addCallback(_check_one_share) d.addCallback(lambda ignored: hunk ./src/allmydata/test/test_web.py 4272 "was corrupt, or that shares have been lost due to server " "departure, hard drive failure, or disk corruption. You " "should perform a filecheck on this object to learn more.") - self.failUnlessEqual(exp, body) + self.failUnlessReallyEqual(exp, body) d.addCallback(_check_unrecoverable_file) d.addCallback(lambda ignored: } Context: [upcase_since_on_welcome terrellrussell@gmail.com**20100708193903] [server_version_on_welcome_page.dpatch.txt freestorm77@gmail.com**20100605191721 Ignore-this: b450c76dc875f5ac8cca229a666cbd0a - The storage server version is 0 for all storage nodes in the Welcome Page ] [NEWS: add NEWS snippets about two recent patches zooko@zooko.com**20100708162058 Ignore-this: 6c9da6a0ad7351a960bdd60f81532899 ] [directory_html_top_banner.dpatch freestorm77@gmail.com**20100622205301 Ignore-this: 1d770d975e0c414c996564774f049bca The div tag with the link "Return to Welcome page" on the directory.xhtml page is not correct ] [tahoe_css_toolbar.dpatch freestorm77@gmail.com**20100622210046 Ignore-this: 5b3ebb2e0f52bbba718a932f80c246c0 CSS modification to be correctly diplayed with Internet Explorer 8 The links on the top of page directory.xhtml are not diplayed in the same line as display with Firefox. ] [runnin_test_tahoe_css.dpatch freestorm77@gmail.com**20100622214714 Ignore-this: e0db73d68740aad09a7b9ae60a08c05c Runnin test for changes in tahoe.css file ] [runnin_test_directory_xhtml.dpatch freestorm77@gmail.com**20100622201403 Ignore-this: f8962463fce50b9466405cb59fe11d43 Runnin test for diretory.xhtml top banner ] [stringutils.py: tolerate sys.stdout having no 'encoding' attribute. david-sarah@jacaranda.org**20100626040817 Ignore-this: f42cad81cef645ee38ac1df4660cc850 ] [quickstart.html: python 2.5 -> 2.6 as recommended version david-sarah@jacaranda.org**20100705175858 Ignore-this: bc3a14645ea1d5435002966ae903199f ] [SFTP: don't call .stopProducing on the producer registered with OverwriteableFileConsumer (which breaks with warner's new downloader). david-sarah@jacaranda.org**20100628231926 Ignore-this: 131b7a5787bc85a9a356b5740d9d996f ] [docs/how_to_make_a_tahoe-lafs_release.txt: trivial correction, install.html should now be quickstart.html. david-sarah@jacaranda.org**20100625223929 Ignore-this: 99a5459cac51bd867cc11ad06927ff30 ] [setup: in the Makefile, refuse to upload tarballs unless someone has passed the environment variable "BB_BRANCH" with value "trunk" zooko@zooko.com**20100619034928 Ignore-this: 276ddf9b6ad7ec79e27474862e0f7d6 ] [trivial: tiny update to in-line comment zooko@zooko.com**20100614045715 Ignore-this: 10851b0ed2abfed542c97749e5d280bc (I'm actually committing this patch as a test of the new eager-annotation-computation of trac-darcs.) ] [docs: about.html link to home page early on, and be decentralized storage instead of cloud storage this time around zooko@zooko.com**20100619065318 Ignore-this: dc6db03f696e5b6d2848699e754d8053 ] [docs: update about.html, especially to have a non-broken link to quickstart.html, and also to comment out the broken links to "for Paranoids" and "for Corporates" zooko@zooko.com**20100619065124 Ignore-this: e292c7f51c337a84ebfeb366fbd24d6c ] [TAG allmydata-tahoe-1.7.0 zooko@zooko.com**20100619052631 Ignore-this: d21e27afe6d85e2e3ba6a3292ba2be1 ] Patch bundle hash: 21fd7975e277394d193e1f00a70dfc844c1d7b76