tests requiring epoll should only run on linux

This commit is contained in:
Job Evers-Meltzer 2016-09-27 16:01:47 -07:00
parent 6803bfae99
commit 12e2827286

View file

@ -1,6 +1,7 @@
import shutil
from multiprocessing import Process, Event, Queue
import logging
import platform
import sys
import random
import io
@ -50,6 +51,15 @@ log_format = "%(funcName)s(): %(message)s"
logging.basicConfig(level=logging.WARNING, format=log_format)
def require_system(system):
def wrapper(fn):
return fn
if platform.system() == system:
return wrapper
else:
return unittest.skip("Skipping. Test can only be run on " + system)
class FakeNode(object):
def __init__(self, *args, **kwargs):
pass
@ -845,6 +855,7 @@ class TestTransfer(TestCase):
return d
@require_system('Linux')
def test_live_transfer(self):
sd_hash_queue = Queue()
@ -940,6 +951,7 @@ class TestTransfer(TestCase):
d.addBoth(stop)
return d
@require_system('Linux')
def test_last_blob_retrieval(self):
kill_event = Event()