mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Add /anything route
This commit is contained in:
@@ -149,6 +149,20 @@ class HttpbinTestCase(unittest.TestCase):
|
||||
self.assertEqual(data['url'], 'http://localhost/get')
|
||||
self.assertTrue(response.data.endswith(b'\n'))
|
||||
|
||||
def test_anything(self):
|
||||
response = self.app.get('/anything')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
response = self.app.get('/anything/foo/bar')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
data = json.loads(response.data.decode('utf-8'))
|
||||
self.assertEqual(data['args'], {})
|
||||
self.assertEqual(data['headers']['Host'], 'localhost')
|
||||
self.assertEqual(data['headers']['Content-Type'], '')
|
||||
self.assertEqual(data['headers']['Content-Length'], '0')
|
||||
self.assertEqual(data['url'], 'http://localhost/anything/foo/bar')
|
||||
self.assertEqual(data['method'], 'GET')
|
||||
self.assertTrue(response.data.endswith(b'\n'))
|
||||
|
||||
def test_base64(self):
|
||||
greeting = u'Здравствуй, мир!'
|
||||
b64_encoded = _string_to_base64(greeting)
|
||||
|
||||
Reference in New Issue
Block a user