Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1293767?usp=email )

Change subject: tests: Remove DataBodyParameterTestCase
......................................................................

tests: Remove DataBodyParameterTestCase

DataBodyParameterTestCase compared whether the result of
http.fetch() was identical when using the body or data
parameter. However, the body parameter was deprecated in
Pywikibot 5.4 (333655c) and removed in Pywikibot 7 (c358f1a).

The test was already adjusted to use identical parameters for
both requests, making the test meaningless.

Change-Id: I8df82d531335ce7b1241831c24f203f3739c07d4
---
M pywikibot/comms/http.py
M tests/http_tests.py
2 files changed, 7 insertions(+), 32 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index d844b4d..c2fcd76 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -304,8 +304,10 @@
     The optional uri is a relative uri from site base uri including the
     document root '/'.
 
+    .. version-changed:: 7.0
+       The *body* parameter was removed; use *data* instead.
     .. version-changed:: 8.2
-       a *protocol* parameter can be given which is passed to the
+       A *protocol* parameter can be given which is passed to the
        :meth:`family.Family.base_url` method.

     :param site: The Site to connect to
@@ -416,6 +418,9 @@
           **kwargs) -> requests.Response:
     """HTTP request.

+    .. version-changed:: 7.0
+        The *body* parameter was removed; use *data* instead.
+
     See :py:obj:`requests.Session.request` for parameters.

     :param uri: URL to send
diff --git a/tests/http_tests.py b/tests/http_tests.py
index c37fdd3..1524dee 100755
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -314,7 +314,7 @@

 class CharsetTestCase(TestCase):

-    """Test that HttpRequest correct handles the charsets given."""
+    """Test that HttpRequest correctly handles the charsets given."""

     CODEC_CANT_DECODE_RE = "codec can't decode byte"
     net = False
@@ -563,36 +563,6 @@
         self.assertEqual(r.json()['args'], {'fish%26chips': 'delicious'})


-class DataBodyParameterTestCase(HttpbinTestCase):
-
-    """Test data and body params of fetch/request methods are equivalent."""
-
-    maxDiff = None
-
-    def test_fetch(self) -> None:
-        """Test that using the data and body params produce same results."""
-        tracker = (
-            'X-Amzn-Trace-Id', 'X-B3-Parentspanid', 'X-B3-Spanid',
-            'X-B3-Traceid', 'X-Forwarded-Client-Cert',
-        )
-        r_data_request = self.fetch(self.get_httpbin_url('/post'),
-                                    method='POST',
-                                    data={'fish&chips': 'delicious'})
-        r_body_request = self.fetch(self.get_httpbin_url('/post'),
-                                    method='POST',
-                                    data={'fish&chips': 'delicious'})
-
-        r_data = r_data_request.json()
-        r_body = r_body_request.json()
-
-        # remove tracker ids if present (T243662, T255862)
-        for tracker_id in tracker:
-            r_data['headers'].pop(tracker_id, None)
-            r_body['headers'].pop(tracker_id, None)
-
-        self.assertEqual(r_data, r_body)
-
-
 if __name__ == '__main__':
     with suppress(SystemExit):
         unittest.main()

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1293767?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8df82d531335ce7b1241831c24f203f3739c07d4
Gerrit-Change-Number: 1293767
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to