diff options
| author | yum <yum.food.vr@gmail.com> | 2023-01-01 21:05:27 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-01-01 21:44:45 -0800 |
| commit | e25bdba3a3a53b09be5269d8b065c13b73ab55c3 (patch) | |
| tree | 1d1dc1d94cde92c2f4f8ce86017395054787515d /FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py | |
| parent | 0d408cc812a094a708edbe4baf536e928731cfc3 (diff) | |
Embed git in package
package.ps1 fetches PortableGit and embeds it in the package. This
eliminates all but one runtime dependency (MSVC++ Redistributable).
* Move Python into a new FOSS folder.
Diffstat (limited to 'FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py')
| -rw-r--r-- | FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py b/FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py new file mode 100644 index 0000000..e8f4b4f --- /dev/null +++ b/FOSS/Python/Dependencies/future-0.18.2/tests/test_future/test_urllib_response.py @@ -0,0 +1,45 @@ +"""Unit tests for code in urllib.response.""" + +from __future__ import absolute_import, division, unicode_literals + +from future.backports import urllib +import future.backports.urllib.response as urllib_response +from future.backports.test import support as test_support +from future.tests.base import unittest + + +class File(object): + + def __init__(self): + self.closed = False + + def read(self, bytes): + pass + + def readline(self): + pass + + def close(self): + self.closed = True + + +class Testaddbase(unittest.TestCase): + + # TODO(jhylton): Write tests for other functionality of addbase() + + def setUp(self): + self.fp = File() + self.addbase = urllib_response.addbase(self.fp) + + def test_with(self): + def f(): + with self.addbase as spam: + pass + self.assertFalse(self.fp.closed) + f() + self.assertTrue(self.fp.closed) + self.assertRaises(ValueError, f) + + +if __name__ == '__main__': + unittest.main() |
