2
0

01_no_urllib3_pypy 4.2 KB

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