summaryrefslogtreecommitdiff
path: root/tests/test_scripts/test_prequest.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-11-12 23:27:59 -0600
committerMichael Merickel <michael@merickel.org>2018-11-12 23:27:59 -0600
commite2c7bbf5566f5be4d1b5b58d3e23948b4dc9b651 (patch)
tree3a777228c4a5c030db2ab8dd6cc9acdfbf146a59 /tests/test_scripts/test_prequest.py
parentd879bdfd477a138746e8593b8d9f30c492ff71e1 (diff)
downloadpyramid-e2c7bbf5566f5be4d1b5b58d3e23948b4dc9b651.tar.gz
pyramid-e2c7bbf5566f5be4d1b5b58d3e23948b4dc9b651.tar.bz2
pyramid-e2c7bbf5566f5be4d1b5b58d3e23948b4dc9b651.zip
get rid of NativeIO alias and a few others
Diffstat (limited to 'tests/test_scripts/test_prequest.py')
-rw-r--r--tests/test_scripts/test_prequest.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/test_scripts/test_prequest.py b/tests/test_scripts/test_prequest.py
index 1521172bc..aadde719a 100644
--- a/tests/test_scripts/test_prequest.py
+++ b/tests/test_scripts/test_prequest.py
@@ -1,3 +1,4 @@
+from io import StringIO
import unittest
from . import dummy
@@ -134,13 +135,11 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, ['abc'])
def test_command_method_post(self):
- from pyramid.compat import NativeIO
-
command = self._makeOne(
['', '--method=POST', 'development.ini', '/'],
[('Content-Type', 'text/html; charset=UTF-8')],
)
- stdin = NativeIO()
+ stdin = StringIO()
command.stdin = stdin
command.run()
self.assertEqual(self._environ['REQUEST_METHOD'], 'POST')
@@ -150,13 +149,11 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, ['abc'])
def test_command_method_put(self):
- from pyramid.compat import NativeIO
-
command = self._makeOne(
['', '--method=PUT', 'development.ini', '/'],
[('Content-Type', 'text/html; charset=UTF-8')],
)
- stdin = NativeIO()
+ stdin = StringIO()
command.stdin = stdin
command.run()
self.assertEqual(self._environ['REQUEST_METHOD'], 'PUT')
@@ -166,13 +163,11 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, ['abc'])
def test_command_method_patch(self):
- from pyramid.compat import NativeIO
-
command = self._makeOne(
['', '--method=PATCH', 'development.ini', '/'],
[('Content-Type', 'text/html; charset=UTF-8')],
)
- stdin = NativeIO()
+ stdin = StringIO()
command.stdin = stdin
command.run()
self.assertEqual(self._environ['REQUEST_METHOD'], 'PATCH')
@@ -182,13 +177,11 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, ['abc'])
def test_command_method_propfind(self):
- from pyramid.compat import NativeIO
-
command = self._makeOne(
['', '--method=PROPFIND', 'development.ini', '/'],
[('Content-Type', 'text/html; charset=UTF-8')],
)
- stdin = NativeIO()
+ stdin = StringIO()
command.stdin = stdin
command.run()
self.assertEqual(self._environ['REQUEST_METHOD'], 'PROPFIND')
@@ -196,13 +189,11 @@ class TestPRequestCommand(unittest.TestCase):
self.assertEqual(self._out, ['abc'])
def test_command_method_options(self):
- from pyramid.compat import NativeIO
-
command = self._makeOne(
['', '--method=OPTIONS', 'development.ini', '/'],
[('Content-Type', 'text/html; charset=UTF-8')],
)
- stdin = NativeIO()
+ stdin = StringIO()
command.stdin = stdin
command.run()
self.assertEqual(self._environ['REQUEST_METHOD'], 'OPTIONS')