From 63ee434fd9db33b4a9105ee5fe5099d1d4e37924 Mon Sep 17 00:00:00 2001 From: comrumino Date: Fri, 26 Jan 2024 22:19:48 -0600 Subject: [PATCH] Fixed errors in test_urllib3.py --- tests/test_urllib3.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/test_urllib3.py b/tests/test_urllib3.py index 15d74560..91f66afb 100644 --- a/tests/test_urllib3.py +++ b/tests/test_urllib3.py @@ -1,12 +1,12 @@ import rpyc -import inspect from rpyc.utils.server import ThreadedServer from rpyc import SlaveService import unittest try: import urllib3 + urllib3.request _urllib3_import_failed = False -except Except: +except Exception: _urllib3_import_failed = True @@ -28,14 +28,13 @@ def tearDown(self): def test_issue(self): self.conn.execute('import urllib3') urllib3_ = self.conn.modules.urllib3 - headers = urllib3.HTTPHeaderDict() - headers.add("Accept", "application/json") - headers.add("Accept", "text/plain") - resp = urllib3_.request( "POST", "https://httpbin.org/post", fields={"hello": "world"}, headers={ "X-Request-Id": "test"}) + # headers = urllib3.HTTPHeaderDict() + # headers.add("Accept", "application/json") + # headers.add("Accept", "text/plain") + headers = {"X-Request-Id": "test"} + resp = urllib3_.request("POST", "https://httpbin.org/post", fields={"hello": "world"}, headers=headers) __import__('code').interact(local=locals() | globals()) - - - #self.assertTrue(self.conn.root.instance(remote_list, list)) + # self.assertTrue(self.conn.root.instance(remote_list, list)) if __name__ == "__main__":