Skip to content

Commit

Permalink
Directly verifying that time and socket are monkey patched
Browse files Browse the repository at this point in the history
This tests makes sure that thew wsgi object properly monkey patched
two needed modules, socket and time.  In bug 988099 it was noted that
the time module was not being monkey patched.  A test was added that
unfortunately introduced a bug and a patch to revert it is here:
https://review.openstack.org/#/c/25107/ in order to fix bug 1158247.
This patch allows for test_server_monkey_patch.py to be removed
without losing the verification of that functionality.

Fixes bug 1158247
Change-Id: I8da6b04d0cc0dae00ba52e5b7350a5e01a76cadb
  • Loading branch information
John Bresnahan committed Mar 25, 2013
1 parent a3c0a5f commit 2ff8b96
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 106 deletions.
106 changes: 0 additions & 106 deletions glance/tests/functional/test_server_monkey_patch.py

This file was deleted.

16 changes: 16 additions & 0 deletions glance/tests/unit/test_wsgi.py
Expand Up @@ -15,6 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.

import socket
import time

import eventlet.patcher
import webob

from glance.common import exception
Expand Down Expand Up @@ -243,3 +247,15 @@ class FakeResponse():
self.assertEqual(v, result[k])
else:
self.assertFalse(k in result)


class TestMonkeyPatch(test_utils.BaseTestCase):

def test_time_is_monkey_patched(self):
"""
Test GET with no redirect
"""
server = wsgi.Server()
server.create_pool()
self.assertTrue(eventlet.patcher.is_monkey_patched(time))
self.assertTrue(eventlet.patcher.is_monkey_patched(socket))

0 comments on commit 2ff8b96

Please sign in to comment.