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 import shutil
from multiprocessing import Process, Event, Queue from multiprocessing import Process, Event, Queue
import logging import logging
import platform
import sys import sys
import random import random
import io import io
@ -50,6 +51,15 @@ log_format = "%(funcName)s(): %(message)s"
logging.basicConfig(level=logging.WARNING, format=log_format) 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): class FakeNode(object):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
pass pass
@ -845,6 +855,7 @@ class TestTransfer(TestCase):
return d return d
@require_system('Linux')
def test_live_transfer(self): def test_live_transfer(self):
sd_hash_queue = Queue() sd_hash_queue = Queue()
@ -940,6 +951,7 @@ class TestTransfer(TestCase):
d.addBoth(stop) d.addBoth(stop)
return d return d
@require_system('Linux')
def test_last_blob_retrieval(self): def test_last_blob_retrieval(self):
kill_event = Event() kill_event = Event()