change assertTrue -> assertEquals for non bools

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
fenn-cs 2021-11-27 00:59:13 +01:00
parent 26419c40bc
commit 54c032d0d7
2 changed files with 5 additions and 5 deletions

View File

@ -241,7 +241,7 @@ class Problems(GridTestMixin, AsyncTestCase, testutil.ShouldFailMixin):
# that ought to work # that ought to work
def _got_node(n): def _got_node(n):
d = n.download_best_version() d = n.download_best_version()
d.addCallback(lambda res: self.assertTrue(res, b"contents 1")) d.addCallback(lambda res: self.assertEquals(res, b"contents 1"))
# now break the second peer # now break the second peer
def _break_peer1(res): def _break_peer1(res):
self.g.break_server(self.server1.get_serverid()) self.g.break_server(self.server1.get_serverid())
@ -249,7 +249,7 @@ class Problems(GridTestMixin, AsyncTestCase, testutil.ShouldFailMixin):
d.addCallback(lambda res: n.overwrite(MutableData(b"contents 2"))) d.addCallback(lambda res: n.overwrite(MutableData(b"contents 2")))
# that ought to work too # that ought to work too
d.addCallback(lambda res: n.download_best_version()) d.addCallback(lambda res: n.download_best_version())
d.addCallback(lambda res: self.assertTrue(res, b"contents 2")) d.addCallback(lambda res: self.assertEquals(res, b"contents 2"))
def _explain_error(f): def _explain_error(f):
print(f) print(f)
if f.check(NotEnoughServersError): if f.check(NotEnoughServersError):
@ -281,7 +281,7 @@ class Problems(GridTestMixin, AsyncTestCase, testutil.ShouldFailMixin):
d = nm.create_mutable_file(MutableData(b"contents 1")) d = nm.create_mutable_file(MutableData(b"contents 1"))
def _created(n): def _created(n):
d = n.download_best_version() d = n.download_best_version()
d.addCallback(lambda res: self.assertTrue(res, b"contents 1")) d.addCallback(lambda res: self.assertEquals(res, b"contents 1"))
# now break one of the remaining servers # now break one of the remaining servers
def _break_second_server(res): def _break_second_server(res):
self.g.break_server(peerids[1]) self.g.break_server(peerids[1])
@ -289,7 +289,7 @@ class Problems(GridTestMixin, AsyncTestCase, testutil.ShouldFailMixin):
d.addCallback(lambda res: n.overwrite(MutableData(b"contents 2"))) d.addCallback(lambda res: n.overwrite(MutableData(b"contents 2")))
# that ought to work too # that ought to work too
d.addCallback(lambda res: n.download_best_version()) d.addCallback(lambda res: n.download_best_version())
d.addCallback(lambda res: self.assertTrue(res, b"contents 2")) d.addCallback(lambda res: self.assertEquals(res, b"contents 2"))
return d return d
d.addCallback(_created) d.addCallback(_created)
return d return d

View File

@ -229,7 +229,7 @@ class Repair(AsyncTestCase, PublishMixin, ShouldFailMixin):
new_versionid = smap.best_recoverable_version() new_versionid = smap.best_recoverable_version()
self.assertThat(new_versionid[0], Equals(5)) # seqnum 5 self.assertThat(new_versionid[0], Equals(5)) # seqnum 5
d2 = self._fn.download_version(smap, new_versionid) d2 = self._fn.download_version(smap, new_versionid)
d2.addCallback(self.assertTrue, expected_contents) d2.addCallback(self.assertEquals, expected_contents)
return d2 return d2
d.addCallback(_check_smap) d.addCallback(_check_smap)
return d return d