01_no_urllib3_pypy 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. diff --git a/dulwich/tests/compat/test_client.py b/dulwich/tests/compat/test_client.py
  2. index f7c3930e..39e6d97c 100644
  3. --- a/dulwich/tests/compat/test_client.py
  4. +++ b/dulwich/tests/compat/test_client.py
  5. @@ -531,6 +531,8 @@ class DulwichHttpClientTest(CompatTestCase, DulwichClientTestBase):
  6. min_git_version = (1, 7, 0, 2)
  7. def setUp(self):
  8. + if '__pypy__' in sys.modules:
  9. + self.skipTest('urllib3 not available for pypy in debian')
  10. CompatTestCase.setUp(self)
  11. DulwichClientTestBase.setUp(self)
  12. self._httpd = HTTPGitServer(("localhost", 0), self.gitroot)
  13. diff --git a/dulwich/tests/test_client.py b/dulwich/tests/test_client.py
  14. index 7d2c464b..01030f70 100644
  15. --- a/dulwich/tests/test_client.py
  16. +++ b/dulwich/tests/test_client.py
  17. @@ -35,7 +35,8 @@ try:
  18. except ImportError:
  19. import urllib.parse as urlparse
  20. -import urllib3
  21. +if '__pypy__' not in sys.modules:
  22. + import urllib3
  23. import dulwich
  24. from dulwich import (
  25. @@ -534,12 +535,20 @@ class TestGetTransportAndPath(TestCase):
  26. self.assertTrue(isinstance(c, SSHGitClient))
  27. def test_http(self):
  28. + if '__pypy__' in sys.modules:
  29. + self.skipTest('urllib3 not available for pypy in debian')
  30. +
  31. +
  32. url = 'https://github.com/jelmer/dulwich'
  33. c, path = get_transport_and_path(url)
  34. self.assertTrue(isinstance(c, HttpGitClient))
  35. self.assertEqual('/jelmer/dulwich', path)
  36. def test_http_auth(self):
  37. + if '__pypy__' in sys.modules:
  38. + self.skipTest('urllib3 not available for pypy in debian')
  39. +
  40. +
  41. url = 'https://user:passwd@github.com/jelmer/dulwich'
  42. c, path = get_transport_and_path(url)
  43. @@ -550,6 +559,10 @@ class TestGetTransportAndPath(TestCase):
  44. self.assertEqual('passwd', c._password)
  45. def test_http_no_auth(self):
  46. + if '__pypy__' in sys.modules:
  47. + self.skipTest('urllib3 not available for pypy in debian')
  48. +
  49. +
  50. url = 'https://github.com/jelmer/dulwich'
  51. c, path = get_transport_and_path(url)
  52. @@ -632,6 +645,9 @@ class TestGetTransportAndPathFromUrl(TestCase):
  53. 'prospero://bar/baz')
  54. def test_http(self):
  55. + if '__pypy__' in sys.modules:
  56. + self.skipTest('urllib3 not available for pypy in debian')
  57. +
  58. url = 'https://github.com/jelmer/dulwich'
  59. c, path = get_transport_and_path_from_url(url)
  60. self.assertTrue(isinstance(c, HttpGitClient))
  61. @@ -863,6 +879,11 @@ class LocalGitClientTests(TestCase):
  62. class HttpGitClientTests(TestCase):
  63. + def setUp(self):
  64. + super(HttpGitClientTests, self).setUp()
  65. + if '__pypy__' in sys.modules:
  66. + self.skipTest('urllib3 not available for pypy in debian')
  67. +
  68. @staticmethod
  69. def b64encode(s):
  70. """Python 2/3 compatible Base64 encoder. Returns string."""
  71. @@ -961,12 +982,18 @@ class TCPGitClientTests(TestCase):
  72. class DefaultUrllib3ManagerTest(TestCase):
  73. + def setUp(self):
  74. + super(DefaultUrllib3ManagerTest, self).setUp()
  75. + if '__pypy__' in sys.modules:
  76. + self.skipTest('urllib3 not available for pypy in debian')
  77. +
  78. def test_no_config(self):
  79. manager = default_urllib3_manager(config=None)
  80. self.assertEqual(manager.connection_pool_kw['cert_reqs'],
  81. 'CERT_REQUIRED')
  82. def test_config_no_proxy(self):
  83. +
  84. manager = default_urllib3_manager(config=ConfigDict())
  85. self.assertNotIsInstance(manager, urllib3.ProxyManager)