chiark / gitweb /
fix "DeprecationWarning: Please use assertEqual instead."
authorHans-Christoph Steiner <hans@eds.org>
Fri, 10 Jun 2016 10:02:03 +0000 (12:02 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 14 Jun 2016 08:06:02 +0000 (10:06 +0200)
They've been deprecated since python 3.2, which was released a long time
ago.

tests/import.TestCase
tests/metadata.TestCase
tests/update.TestCase

index c53b53d46446739e7376629e1059bb39f1d7d317..4d5acc56520a8a95f7010d61571cec574f64c67d 100755 (executable)
@@ -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__":
index c287a212723db8723326ceb51490f0072d64d844..0cdf3164861576067019e8815b7662a8ecd1190a 100755 (executable)
@@ -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)
index 0cc93e5c8b8880dd0c2200587b98b3310944f488..6de1cf218601599ef62a00ad1028a3e180cf0db8 100755 (executable)
@@ -55,13 +55,13 @@ 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),
-                          "python sig not equal to java sig!")
-        self.assertEquals(len(sig), len(pysig),
-                          "the length of the two sigs are different!")
+        self.assertEqual(sig, fdroidserver.update.getsig(apkfile),
+                         "python sig not equal to java sig!")
+        self.assertEqual(len(sig), len(pysig),
+                         "the length of the two sigs are different!")
         try:
-            self.assertEquals(unhexlify(sig), unhexlify(pysig),
-                              "the length of the two sigs are different!")
+            self.assertEqual(unhexlify(sig), unhexlify(pysig),
+                             "the length of the two sigs are different!")
         except TypeError as e:
             print(e)
             self.assertTrue(False, 'TypeError!')