Skip to content
Myr

added simple test fixture for Postbin and posting

Before adoption: this commit came in with the history the project adopted, so no landing records it.

both files and data

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 324c572 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:test_requests.py+14 added
1#!/usr/bin/env python2# -*- coding: utf-8 -*-345import unittest6from cStringIO import StringIO78import requests910
32 unmodified lines
43 r = requests.get(url, auth=auth)4445 self.assertEqual(r.status_code, 200)4647 def test_POSTBIN_GET_POST_FILES(self):4849 bin = requests.post('http://www.postbin.org/')50 self.assertEqual(bin.status_code, 200)5152 post = requests.post(bin.url, data={'some': 'data'})53 self.assertEqual(post.status_code, 201)5455 post2 = requests.post(bin.url, files={'some': StringIO('data')})56 self.assertEqual(post2.status_code, 201)57585960if __name__ == '__main__':61 unittest.main()