Kumar Varadarajulu
b94decc47c
Combined tests to one tests for should_bypass_proxies method
2016-05-16 10:49:37 +00:00
Kumar Varadarajulu
f59a95713e
Added tests for should_bypass_proxies function
2016-05-16 10:40:22 +00:00
John R. Lenton
4e7beef860
utils: let select_proxy not raise an exception when url has no hostname
2016-04-26 11:22:44 +01:00
Dmitry Dygalo
1eb153529a
Merge remote-tracking branch 'upstream/master' into utils-unit-tests
...
Conflicts:
tests/test_utils.py
2016-03-13 10:24:47 +01:00
Cory Benfield
6cc0b56d51
Switch to treat files without tell() as zero-length
2016-03-07 09:05:43 +00:00
Cory Benfield
e034dd1140
Allow for exceptions from tell()
2016-03-07 08:31:23 +00:00
Dmitry Dygalo
f123f89d32
Added unit tests for utils module
2016-02-19 10:32:23 +01:00
kennethreitz
bbadf47a8f
syntax changes
2016-02-05 15:53:59 -05:00
Dmitry Dygalo
18b26d20f7
Added tests module.
2016-02-05 13:21:57 +01:00
Kenneth Reitz
e4c4c80b82
remove all old tests
2012-12-17 07:27:25 -05:00
Cory Benfield
c02520ed99
Make sure we reset environment variables.
...
Turns out nose runs all the tests in one process, so changing the
os.environ dictionary makes everything go horribly wrong.
2012-11-18 12:31:55 +00:00
Cory Benfield
8da100f652
Respect the no_proxy environment variable.
...
This change is in response to issue #879 .
2012-11-18 12:06:33 +00:00
Martijn Pieters
e26ccb34eb
Fix the smoke test in the face of UTF-16 surrogate pairs.
...
If the random data starts with a UTF-16 BOM *and* the next two bytes are for a character in the `\ud800`-`\udfff` range decoding would fail. Small chance, but still possible.
Extend it to check the UTF-8 error as well. The goal is to test that the guesser was *mostly* correct, and to verify the cases where it wasn't that it was to be expected. Most of all that the function doesn't buckle under wildly unexpected data.
2012-10-26 12:15:27 +02:00
Martijn Pieters
be01a35ef1
Better not call it chr, rename to byteschr.
2012-10-25 18:27:21 +02:00
Martijn Pieters
a4be9a2578
Redefine the unichr and bytes-variant of chr at module level.
...
Needed to appease Travis; it's python 2.6 and 2.7 builds are weird and the `__builtins__` dict is not following CPython conventions.
2012-10-25 18:22:07 +02:00
Martijn Pieters
9832bd8917
Correct a c&p mistake: set a correct docstring for the unit test class.
2012-10-25 17:56:19 +02:00
Martijn Pieters
4decc7986e
Use a JSON-specific encoding detection when no encoding has been specified.
...
JSON *must* be encoded using UTF-8, UTF-16 or UTF-32 (see the [RFC][1]; detect the encoding based on the fact that JSON always starts with 2 ASCII characters.
[1]: http://tools.ietf.org/html/rfc4627#section-3
2012-10-25 17:43:52 +02:00