jayvdb / anyhttp

HTTP client interface
MIT License
0 stars 2 forks source link

httpstream and httq TestGetText fail locally on py27 with --sitepackages #16

Open jayvdb opened 3 years ago

jayvdb commented 3 years ago

These two are re-writing the HTML, possibly due to different versions of deps such as bs4

jayvdb commented 3 years ago

This gets closer to green

diff --git a/tests/http_tests.py b/tests/http_tests.py
index bf0d0ea..b38759c 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -153,6 +153,12 @@ class TestGetText(TestAll):
     def check_response(self, value):
         # assertEqual will dump out lots of unreadable information
         self.assertTrue(value)
+        if self.package in ['httpstream', 'httq']:
+            value = value.strip('\n')
+            value = value.replace('</body></html>', '')
+            value = value.replace('<html><body>', '')
+            self.expected_value = self.expected_value.replace('</body></html>', '')
+            self.expected_value = self.expected_value.replace('<html><body>', '')
         self.assertEqual(value, self.expected_value)