urllib.request._opener

Here are the examples of the python api urllib.request._opener taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: ironpython3 Source File: test_register.py
Function: set_up
    def setUp(self):
        super(RegisterTestCase, self).setUp()
        # patching the password prompt
        self._old_getpass = getpass.getpass
        def _getpass(prompt):
            return 'password'
        getpass.getpass = _getpass
        urllib.request._opener = None
        self.old_opener = urllib.request.build_opener
        self.conn = urllib.request.build_opener = FakeOpener()

Example 2

Project: ironpython3 Source File: test_register.py
Function: tear_down
    def tearDown(self):
        getpass.getpass = self._old_getpass
        urllib.request._opener = None
        urllib.request.build_opener = self.old_opener
        super(RegisterTestCase, self).tearDown()