01_no_urllib3_pypy 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. === modified file 'dulwich/tests/compat/test_client.py'
  2. Index: dulwich/dulwich/tests/compat/test_client.py
  3. ===================================================================
  4. --- dulwich.orig/dulwich/tests/compat/test_client.py
  5. +++ dulwich/dulwich/tests/compat/test_client.py
  6. @@ -544,6 +544,8 @@ class DulwichHttpClientTest(CompatTestCa
  7. min_git_version = (1, 7, 0, 2)
  8. def setUp(self):
  9. + if '__pypy__' in sys.modules:
  10. + self.skipTest('urllib3 not available for pypy in debian')
  11. CompatTestCase.setUp(self)
  12. DulwichClientTestBase.setUp(self)
  13. self._httpd = HTTPGitServer(("localhost", 0), self.gitroot)
  14. Index: dulwich/dulwich/tests/test_client.py
  15. ===================================================================
  16. --- dulwich.orig/dulwich/tests/test_client.py
  17. +++ dulwich/dulwich/tests/test_client.py
  18. @@ -35,7 +35,8 @@ try:
  19. except ImportError:
  20. import urllib.parse as urlparse
  21. -import urllib3
  22. +if '__pypy__' not in sys.modules:
  23. + import urllib3
  24. import dulwich
  25. from dulwich import (
  26. @@ -551,12 +552,20 @@ class TestGetTransportAndPath(TestCase):
  27. self.assertTrue(isinstance(c, SSHGitClient))
  28. def test_http(self):
  29. + if '__pypy__' in sys.modules:
  30. + self.skipTest('urllib3 not available for pypy in debian')
  31. +
  32. +
  33. url = 'https://github.com/jelmer/dulwich'
  34. c, path = get_transport_and_path(url)
  35. self.assertTrue(isinstance(c, HttpGitClient))
  36. self.assertEqual('/jelmer/dulwich', path)
  37. def test_http_auth(self):
  38. + if '__pypy__' in sys.modules:
  39. + self.skipTest('urllib3 not available for pypy in debian')
  40. +
  41. +
  42. url = 'https://user:passwd@github.com/jelmer/dulwich'
  43. c, path = get_transport_and_path(url)
  44. @@ -567,6 +576,9 @@ class TestGetTransportAndPath(TestCase):
  45. self.assertEqual('passwd', c._password)
  46. def test_http_auth_with_username(self):
  47. + if '__pypy__' in sys.modules:
  48. + self.skipTest('urllib3 not available for pypy in debian')
  49. +
  50. url = 'https://github.com/jelmer/dulwich'
  51. c, path = get_transport_and_path(
  52. @@ -578,6 +590,9 @@ class TestGetTransportAndPath(TestCase):
  53. self.assertEqual('blah', c._password)
  54. def test_http_auth_with_username_and_in_url(self):
  55. + if '__pypy__' in sys.modules:
  56. + self.skipTest('urllib3 not available for pypy in debian')
  57. +
  58. url = 'https://user:passwd@github.com/jelmer/dulwich'
  59. c, path = get_transport_and_path(
  60. @@ -589,6 +604,10 @@ class TestGetTransportAndPath(TestCase):
  61. self.assertEqual('passwd', c._password)
  62. def test_http_no_auth(self):
  63. + if '__pypy__' in sys.modules:
  64. + self.skipTest('urllib3 not available for pypy in debian')
  65. +
  66. +
  67. url = 'https://github.com/jelmer/dulwich'
  68. c, path = get_transport_and_path(url)
  69. @@ -671,6 +690,9 @@ class TestGetTransportAndPathFromUrl(Tes
  70. 'prospero://bar/baz')
  71. def test_http(self):
  72. + if '__pypy__' in sys.modules:
  73. + self.skipTest('urllib3 not available for pypy in debian')
  74. +
  75. url = 'https://github.com/jelmer/dulwich'
  76. c, path = get_transport_and_path_from_url(url)
  77. self.assertTrue(isinstance(c, HttpGitClient))
  78. @@ -678,6 +700,9 @@ class TestGetTransportAndPathFromUrl(Tes
  79. self.assertEqual('/jelmer/dulwich', path)
  80. def test_http_port(self):
  81. + if '__pypy__' in sys.modules:
  82. + self.skipTest('urllib3 not available for pypy in debian')
  83. +
  84. url = 'https://github.com:9090/jelmer/dulwich'
  85. c, path = get_transport_and_path_from_url(url)
  86. self.assertEqual('https://github.com:9090', c.get_url(b'/'))
  87. @@ -910,6 +935,11 @@ class LocalGitClientTests(TestCase):
  88. class HttpGitClientTests(TestCase):
  89. + def setUp(self):
  90. + super(HttpGitClientTests, self).setUp()
  91. + if '__pypy__' in sys.modules:
  92. + self.skipTest('urllib3 not available for pypy in debian')
  93. +
  94. @staticmethod
  95. def b64encode(s):
  96. """Python 2/3 compatible Base64 encoder. Returns string."""
  97. @@ -1088,12 +1118,18 @@ class TCPGitClientTests(TestCase):
  98. class DefaultUrllib3ManagerTest(TestCase):
  99. + def setUp(self):
  100. + super(DefaultUrllib3ManagerTest, self).setUp()
  101. + if '__pypy__' in sys.modules:
  102. + self.skipTest('urllib3 not available for pypy in debian')
  103. +
  104. def test_no_config(self):
  105. manager = default_urllib3_manager(config=None)
  106. self.assertEqual(manager.connection_pool_kw['cert_reqs'],
  107. 'CERT_REQUIRED')
  108. def test_config_no_proxy(self):
  109. +
  110. manager = default_urllib3_manager(config=ConfigDict())
  111. self.assertNotIsInstance(manager, urllib3.ProxyManager)