Commit 20fdac07 authored by rm's avatar rm
Browse files

A simple HTTP Request & Response Service.

WWW: https://github.com/postmanlabs/httpbin

PR:		251847
Submitted by:	contact@evilham.com
parent 5cf28c80
...@@ -1641,6 +1641,7 @@ ...@@ -1641,6 +1641,7 @@
SUBDIR += py-html5-parser SUBDIR += py-html5-parser
SUBDIR += py-html5lib SUBDIR += py-html5lib
SUBDIR += py-httmock SUBDIR += py-httmock
SUBDIR += py-httpbin
SUBDIR += py-httpcore SUBDIR += py-httpcore
SUBDIR += py-httpie SUBDIR += py-httpie
SUBDIR += py-httplib2 SUBDIR += py-httplib2
......
# $FreeBSD$
PORTNAME= httpbin
PORTVERSION= 0.7.0
CATEGORIES= www python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= contact@evilham.com
COMMENT= HTTP Request & Response Service
LICENSE= ISCL
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}blinker>=1.1:devel/py-blinker@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}brotlipy>=0:archivers/py-brotlipy@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}decorator>=0:devel/py-decorator@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}markupsafe>=0:textproc/py-markupsafe@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}Flask>=0:www/py-flask@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}itsdangerous>=0:security/py-itsdangerous@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}raven>=0:devel/py-raven@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}werkzeug>=0.14.1:www/py-werkzeug@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR}
USES= python
USE_PYTHON= autoplist concurrent distutils
do-test:
@cd ${WRKSRC} && ${PYTHON_CMD} test_httpbin.py
.include <bsd.port.mk>
TIMESTAMP = 1607953372
SHA256 (httpbin-0.7.0.tar.gz) = cbb37790c91575f4f15757f42ad41d9f729eb227d5edbe89e4ec175486db8dfa
SIZE (httpbin-0.7.0.tar.gz) = 92613
--- test_httpbin.py.orig 2018-05-08 11:41:03 UTC
+++ test_httpbin.py
@@ -144,7 +144,9 @@ class HttpbinTestCase(unittest.TestCase):
data = json.loads(response.data.decode('utf-8'))
self.assertEqual(data['args'], {})
self.assertEqual(data['headers']['Host'], 'localhost')
- self.assertEqual(data['headers']['Content-Length'], '0')
+ # Newest Werkzeug versions omit Content-Length if '0'; see
+ # https://github.com/postmanlabs/httpbin/pull/555/files
+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0')
self.assertEqual(data['headers']['User-Agent'], 'test')
# self.assertEqual(data['origin'], None)
self.assertEqual(data['url'], 'http://localhost/get')
@@ -158,7 +160,9 @@ class HttpbinTestCase(unittest.TestCase):
data = json.loads(response.data.decode('utf-8'))
self.assertEqual(data['args'], {})
self.assertEqual(data['headers']['Host'], 'localhost')
- self.assertEqual(data['headers']['Content-Length'], '0')
+ # Newest Werkzeug versions omit Content-Length if '0'; see
+ # https://github.com/postmanlabs/httpbin/pull/555/files
+ self.assertEqual(data['headers'].get('Content-Length', '0'), '0')
self.assertEqual(data['url'], 'http://localhost/anything/foo/bar')
self.assertEqual(data['method'], 'GET')
self.assertTrue(response.data.endswith(b'\n'))
A simple HTTP Request & Response Service.
WWW: https://github.com/postmanlabs/httpbin
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment