fix "DeprecationWarning: Please use assertEqual instead."

They've been deprecated since python 3.2, which was released a long time
ago.
This commit is contained in:
Hans-Christoph Steiner 2016-06-10 12:02:03 +02:00
parent f68830127e
commit 547a57e693
3 changed files with 10 additions and 10 deletions

View file

@ -33,9 +33,9 @@ class ImportTest(unittest.TestCase):
app = fdroidserver.metadata.get_default_app_info()
app.UpdateCheckMode = "Tags"
root_dir, src_dir = import_proxy.get_metadata_from_url(app, url)
self.assertEquals(app.RepoType, 'git')
self.assertEquals(app.WebSite, 'https://gitlab.com/fdroid/fdroidclient')
self.assertEquals(app.Repo, 'https://gitlab.com/fdroid/fdroidclient.git')
self.assertEqual(app.RepoType, 'git')
self.assertEqual(app.WebSite, 'https://gitlab.com/fdroid/fdroidclient')
self.assertEqual(app.Repo, 'https://gitlab.com/fdroid/fdroidclient.git')
if __name__ == "__main__":

View file

@ -44,7 +44,7 @@ class MetadataTest(unittest.TestCase):
self.assertTrue(appid in apps)
with open(savepath, 'rb') as f:
frompickle = pickle.load(f)
self.assertEquals(frommeta, frompickle)
self.assertEqual(frommeta, frompickle)
# Uncomment to overwrite
# with open(savepath, 'wb') as f:
# pickle.dump(frommeta, f)

View file

@ -55,12 +55,12 @@ class UpdateTest(unittest.TestCase):
self.assertIsNotNone(sig, "sig is None")
pysig = fdroidserver.update.getsig(apkfile)
self.assertIsNotNone(pysig, "pysig is None")
self.assertEquals(sig, fdroidserver.update.getsig(apkfile),
self.assertEqual(sig, fdroidserver.update.getsig(apkfile),
"python sig not equal to java sig!")
self.assertEquals(len(sig), len(pysig),
self.assertEqual(len(sig), len(pysig),
"the length of the two sigs are different!")
try:
self.assertEquals(unhexlify(sig), unhexlify(pysig),
self.assertEqual(unhexlify(sig), unhexlify(pysig),
"the length of the two sigs are different!")
except TypeError as e:
print(e)