Mercurial > p > roundup > code
comparison test/test_liveserver.py @ 7909:80cf6098ea65
issue2551334 - Get test suite to pass using windows python
Mark classes that use requests library with skip markers if requests is
not available.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 28 Apr 2024 00:08:42 -0400 |
| parents | 0fe2b9f6e19f |
| children | 4cca0ae9f901 |
comparison
equal
deleted
inserted
replaced
| 7908:608f140237c9 | 7909:80cf6098ea65 |
|---|---|
| 137 # wsgiref/validator.py InputWrapper::readline is broke and | 137 # wsgiref/validator.py InputWrapper::readline is broke and |
| 138 # doesn't support the max bytes to read argument. | 138 # doesn't support the max bytes to read argument. |
| 139 return RequestDispatcher(self.dirname) | 139 return RequestDispatcher(self.dirname) |
| 140 | 140 |
| 141 | 141 |
| 142 @skip_requests | |
| 142 class BaseTestCases(WsgiSetup): | 143 class BaseTestCases(WsgiSetup): |
| 143 """Class with all tests to run against wsgi server. Is reused when | 144 """Class with all tests to run against wsgi server. Is reused when |
| 144 wsgi server is started with various feature flags | 145 wsgi server is started with various feature flags |
| 145 """ | 146 """ |
| 146 | 147 |
| 1215 | 1216 |
| 1216 def test_fts(self): | 1217 def test_fts(self): |
| 1217 f = requests.get(self.url_base() + "?@search_text=RESULT") | 1218 f = requests.get(self.url_base() + "?@search_text=RESULT") |
| 1218 self.assertIn("foo bar", f.text) | 1219 self.assertIn("foo bar", f.text) |
| 1219 | 1220 |
| 1221 @skip_requests | |
| 1220 class TestFeatureFlagCacheTrackerOff(BaseTestCases, WsgiSetup): | 1222 class TestFeatureFlagCacheTrackerOff(BaseTestCases, WsgiSetup): |
| 1221 """Class to run all test in BaseTestCases with the cache_tracker | 1223 """Class to run all test in BaseTestCases with the cache_tracker |
| 1222 feature flag disabled when starting the wsgi server | 1224 feature flag disabled when starting the wsgi server |
| 1223 """ | 1225 """ |
| 1224 def create_app(self): | 1226 def create_app(self): |
| 1230 # wsgiref/validator.py InputWrapper::readline is broke and | 1232 # wsgiref/validator.py InputWrapper::readline is broke and |
| 1231 # doesn't support the max bytes to read argument. | 1233 # doesn't support the max bytes to read argument. |
| 1232 return RequestDispatcher(self.dirname, feature_flags=ff) | 1234 return RequestDispatcher(self.dirname, feature_flags=ff) |
| 1233 | 1235 |
| 1234 @skip_postgresql | 1236 @skip_postgresql |
| 1237 @skip_requests | |
| 1235 class TestPostgresWsgiServer(BaseTestCases, WsgiSetup): | 1238 class TestPostgresWsgiServer(BaseTestCases, WsgiSetup): |
| 1236 """Class to run all test in BaseTestCases with the cache_tracker | 1239 """Class to run all test in BaseTestCases with the cache_tracker |
| 1237 feature enabled when starting the wsgi server | 1240 feature enabled when starting the wsgi server |
| 1238 """ | 1241 """ |
| 1239 | 1242 |
| 1317 | 1320 |
| 1318 # use a ts: search as well so it only works on postgres_fts indexer | 1321 # use a ts: search as well so it only works on postgres_fts indexer |
| 1319 f = requests.get(self.url_base() + "?@search_text=ts:RESULT") | 1322 f = requests.get(self.url_base() + "?@search_text=ts:RESULT") |
| 1320 self.assertIn("foo bar RESULT", f.text) | 1323 self.assertIn("foo bar RESULT", f.text) |
| 1321 | 1324 |
| 1325 @skip_requests | |
| 1322 class TestApiRateLogin(WsgiSetup): | 1326 class TestApiRateLogin(WsgiSetup): |
| 1323 """Class to run test in BaseTestCases with the cache_tracker | 1327 """Class to run test in BaseTestCases with the cache_tracker |
| 1324 feature flag enabled when starting the wsgi server | 1328 feature flag enabled when starting the wsgi server |
| 1325 """ | 1329 """ |
| 1326 | 1330 |
