Skip to content

Commit

Permalink
Renamed the certificates
Browse files Browse the repository at this point in the history
Removed references to pyevent
  • Loading branch information
Alvaro committed Nov 16, 2012
1 parent 20f945e commit d3e662e
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 113 deletions.
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,5 @@ def get_database_auth ():
pass
return retval

certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')
certificate_file = os.path.join(os.path.dirname(__file__), 'server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'server.key')
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
from evy.green import socket
from tests import LimitedTestCase, s2b, skip_if_no_ssl

certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')
certificate_file = os.path.join(os.path.dirname(__file__), 'server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'server.key')

class TestServe(LimitedTestCase):
def setUp (self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_db_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def create_pool (self, min_size = 0, max_size = 1, max_idle = 10, max_age = 10,
**self._auth)


@skip_with_pyevent

def setUp (self):
super(TpoolConnectionPool, self).setUp()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_green_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ class TestGreenIoStarvation(LimitedTestCase):
TEST_TIMEOUT = 300 # the test here might take a while depending on the OS

@skipped # by rdw, because it fails but it's not clear how to make it pass
@skip_with_pyevent

def test_server_starvation (self, sendloops = 15):
recvsize = 2 * min_buf_size()
sendsize = 10000 * recvsize
Expand Down
13 changes: 6 additions & 7 deletions tests/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def noop ():
class TestTimerCleanup(LimitedTestCase):
TEST_TIMEOUT = 2

@skip_with_pyevent

def test_cancel_immediate (self):
hub = hubs.get_hub()
stimers = hub.timers_count
Expand All @@ -56,7 +56,7 @@ def test_cancel_immediate (self):
self.assert_less_than_equal(hub.timers_count, 1000 + stimers)


@skip_with_pyevent

def test_cancel_accumulated (self):
hub = hubs.get_hub()
stimers = hub.timers_count
Expand All @@ -68,7 +68,7 @@ def test_cancel_accumulated (self):

self.assert_less_than_equal(hub.timers_count, 1000 + stimers)

@skip_with_pyevent

def test_cancel_proportion (self):
# if fewer than half the pending timers are canceled, it should
# not clean them out
Expand Down Expand Up @@ -152,7 +152,7 @@ def fail ():
class TestHubBlockingDetector(LimitedTestCase):
TEST_TIMEOUT = 10

@skip_with_pyevent

def test_block_detect (self):
def look_im_blocking ():
import time
Expand All @@ -166,12 +166,11 @@ def look_im_blocking ():
self.assertRaises(RuntimeError, gt.wait)
debug.hub_blocking_detection(False)

@skip_with_pyevent

@skip_if_no_itimer
def test_block_detect_with_itimer (self):
def look_im_blocking ():
import time

time.sleep(0.5)

from evy import debug
Expand Down Expand Up @@ -238,7 +237,7 @@ def test_repeated_selects (self):


class TestFork(ProcessBase):
@skip_with_pyevent

def test_fork (self):
new_mod = """
import os
Expand Down
5 changes: 2 additions & 3 deletions tests/test_mysqldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@


import os
import sys
import time
import traceback
from tests import skipped, skip_unless, using_pyevent, get_database_auth, LimitedTestCase
Expand All @@ -41,6 +40,8 @@
except ImportError:
MySQLdb = False



def mysql_requirement (_f):
"""We want to skip tests if using pyevent, MySQLdb is not installed, or if
there is no database running on the localhost that the auth file grants
Expand All @@ -49,8 +50,6 @@ def mysql_requirement (_f):
This errs on the side of skipping tests if everything is not right, but
it's better than a million tests failing when you don't care about mysql
support."""
if using_pyevent(_f):
return False
if MySQLdb is False:
print "Skipping mysql tests, MySQLdb not importable"
return False
Expand Down
1 change: 1 addition & 0 deletions tests/test_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def create (self):


class TestIntPool(TestCase):

def setUp (self):
self.pool = IntPool(min_size = 0, max_size = 4)

Expand Down
62 changes: 31 additions & 31 deletions tests/test_saranwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def assert_server_exists (self, prox):
self.assertEqual(0, prox.foo)

@skip_on_windows
@skip_with_pyevent

def test_wrap_tuple (self):
my_tuple = (1, 2)
prox = saranwrap.wrap(my_tuple)
Expand All @@ -87,7 +87,7 @@ def test_wrap_tuple (self):
self.assertEqual(len(my_tuple), 2)

@skip_on_windows
@skip_with_pyevent

def test_wrap_string (self):
my_object = "whatever"
prox = saranwrap.wrap(my_object)
Expand All @@ -96,7 +96,7 @@ def test_wrap_string (self):
self.assertEqual(my_object.join(['a', 'b']), prox.join(['a', 'b']))

@skip_on_windows
@skip_with_pyevent

def test_wrap_uniterable (self):
# here we're treating the exception as just a normal class
prox = saranwrap.wrap(FloatingPointError())
Expand All @@ -111,7 +111,7 @@ def key ():
self.assertRaises(TypeError, key)

@skip_on_windows
@skip_with_pyevent

def test_wrap_dict (self):
my_object = {'a': 1}
prox = saranwrap.wrap(my_object)
Expand All @@ -121,7 +121,7 @@ def test_wrap_dict (self):
self.assertEqual('saran:' + repr(my_object), repr(prox))

@skip_on_windows
@skip_with_pyevent

def test_wrap_module_class (self):
prox = saranwrap.wrap(re)
self.assertEqual(saranwrap.Proxy, type(prox))
Expand All @@ -130,7 +130,7 @@ def test_wrap_module_class (self):
self.assert_(repr(prox.compile))

@skip_on_windows
@skip_with_pyevent

def test_wrap_eq (self):
prox = saranwrap.wrap(re)
exp1 = prox.compile('.')
Expand All @@ -140,7 +140,7 @@ def test_wrap_eq (self):
self.assert_(exp1 != exp3)

@skip_on_windows
@skip_with_pyevent

def test_wrap_nonzero (self):
prox = saranwrap.wrap(re)
exp1 = prox.compile('.')
Expand All @@ -149,7 +149,7 @@ def test_wrap_nonzero (self):
self.assert_(bool(prox2))

@skip_on_windows
@skip_with_pyevent

def test_multiple_wraps (self):
prox1 = saranwrap.wrap(re)
prox2 = saranwrap.wrap(re)
Expand All @@ -159,7 +159,7 @@ def test_multiple_wraps (self):
x3 = prox2.compile('.')

@skip_on_windows
@skip_with_pyevent

def test_dict_passthru (self):
prox = saranwrap.wrap(StringIO)
x = prox.StringIO('a')
Expand All @@ -169,26 +169,26 @@ def test_dict_passthru (self):
saranwrap.ObjectProxy)

@skip_on_windows
@skip_with_pyevent

def test_is_value (self):
server = saranwrap.Server(None, None, None)
self.assert_(server.is_value(None))

@skip_on_windows
@skip_with_pyevent

def test_wrap_getitem (self):
prox = saranwrap.wrap([0, 1, 2])
self.assertEqual(prox[0], 0)

@skip_on_windows
@skip_with_pyevent

def test_wrap_setitem (self):
prox = saranwrap.wrap([0, 1, 2])
prox[1] = 2
self.assertEqual(prox[1], 2)

@skip_on_windows
@skip_with_pyevent

def test_raising_exceptions (self):
prox = saranwrap.wrap(re)

Expand All @@ -198,7 +198,7 @@ def nofunc ():
self.assertRaises(AttributeError, nofunc)

@skip_on_windows
@skip_with_pyevent

def test_unpicklable_server_exception (self):
prox = saranwrap.wrap(saranwrap)

Expand All @@ -211,7 +211,7 @@ def unpickle ():
#self.assert_server_exists(prox)

@skip_on_windows
@skip_with_pyevent

def test_pickleable_server_exception (self):
prox = saranwrap.wrap(saranwrap)

Expand All @@ -222,21 +222,21 @@ def fperror ():
self.assert_server_exists(prox)

@skip_on_windows
@skip_with_pyevent

def test_print_does_not_break_wrapper (self):
prox = saranwrap.wrap(saranwrap)
prox.print_string('hello')
self.assert_server_exists(prox)

@skip_on_windows
@skip_with_pyevent

def test_stderr_does_not_break_wrapper (self):
prox = saranwrap.wrap(saranwrap)
prox.err_string('goodbye')
self.assert_server_exists(prox)

@skip_on_windows
@skip_with_pyevent

def test_status (self):
prox = saranwrap.wrap(time)
a = prox.gmtime(0)
Expand All @@ -256,7 +256,7 @@ def test_status (self):
self.assert_(status['pid'] != saranwrap.status(prox2)['pid'])

@skip_on_windows
@skip_with_pyevent

def test_del (self):
prox = saranwrap.wrap(time)
delme = prox.gmtime(0)
Expand All @@ -271,14 +271,14 @@ def test_del (self):
self.assertLessThan(status_after['object_count'], status_before['object_count'])

@skip_on_windows
@skip_with_pyevent

def test_contains (self):
prox = saranwrap.wrap({'a': 'b'})
self.assert_('a' in prox)
self.assert_('x' not in prox)

@skip_on_windows
@skip_with_pyevent

def test_variable_and_keyword_arguments_with_function_calls (self):
import optparse

Expand All @@ -289,7 +289,7 @@ def test_variable_and_keyword_arguments_with_function_calls (self):
self.assertEqual(opts.n, 'foo')

@skip_on_windows
@skip_with_pyevent

def test_original_proxy_going_out_of_scope (self):
def make_re ():
prox = saranwrap.wrap(re)
Expand Down Expand Up @@ -317,7 +317,7 @@ def test_status_of_none (self):
pass

@skip_on_windows
@skip_with_pyevent

def test_not_inheriting_pythonpath (self):
# construct a fake module in the temp directory
temp_dir = tempfile.mkdtemp("saranwrap_test")
Expand Down Expand Up @@ -350,7 +350,7 @@ def test_not_inheriting_pythonpath (self):
sys.path.remove(temp_dir)

@skip_on_windows
@skip_with_pyevent

def test_contention (self):
from tests import saranwrap_test

Expand All @@ -363,7 +363,7 @@ def test_contention (self):
pool.waitall()

@skip_on_windows
@skip_with_pyevent

def test_copy (self):
import copy

Expand All @@ -380,7 +380,7 @@ def make_assertions (copied):
make_assertions(copy.deepcopy(prox))

@skip_on_windows
@skip_with_pyevent

def test_list_of_functions (self):
return # this test is known to fail, we can implement it sometime in the future if we wish
from tests import saranwrap_test
Expand All @@ -389,7 +389,7 @@ def test_list_of_functions (self):
self.assertEquals(list_maker(), prox[0]())

@skip_on_windows
@skip_with_pyevent

def test_under_the_hood_coroutines (self):
# so, we want to write a class which uses a coroutine to call
# a function. Then we want to saranwrap that class, have
Expand All @@ -410,7 +410,7 @@ def test_under_the_hood_coroutines (self):
'Coroutine in saranwrapped object did not run')

@skip_on_windows
@skip_with_pyevent

def test_child_process_death (self):
prox = saranwrap.wrap({})
pid = saranwrap.getpid(prox)
Expand All @@ -420,19 +420,19 @@ def test_child_process_death (self):
self.assertRaises(OSError, os.kill, pid, 0) # raises OSError if pid doesn't exist

@skip_on_windows
@skip_with_pyevent

def test_detection_of_server_crash (self):
# make the server crash here
pass

@skip_on_windows
@skip_with_pyevent

def test_equality_with_local_object (self):
# we'll implement this if there's a use case for it
pass

@skip_on_windows
@skip_with_pyevent

def test_non_blocking (self):
# here we test whether it's nonblocking
pass
Expand Down
Loading

0 comments on commit d3e662e

Please sign in to comment.