Skip to content

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Oct 22, 2017
1 parent 247f9fc commit 31b7743
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tests/runtime/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from uwsgiconf.runtime.environ import *
from uwsgiconf.runtime.logging import *
from uwsgiconf.runtime.request import *
from uwsgiconf.runtime.scheduling import *
from uwsgiconf.runtime.signals import *
from uwsgiconf.runtime.websockets import *


Expand All @@ -19,12 +17,3 @@ def doomed():

with harakiri_imposed(1):
pass


def test_signals():

sig = Signal()

@sig.register_handler()
def signalled():
pass
19 changes: 19 additions & 0 deletions tests/runtime/test_runtime_scheduling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from uwsgiconf.runtime.scheduling import *


def test_timers():

@register_timer(20)
def fire1():
pass

@register_timer_rb(3)
def fire2():
pass


def test_cron():

@register_cron(hour=-3)
def fire1():
pass
23 changes: 23 additions & 0 deletions tests/runtime/test_runtime_signals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from uwsgiconf.runtime.signals import *
from uwsgiconf.runtime.scheduling import register_timer


def test_signals():

available = get_available_num()
latest = get_last_received()

sig = Signal()

@sig.register_handler()
def signalled():
pass

sig.send()
sig.wait()

@sig.register_handler()
def my(sign):
pass

register_timer(3, sig)

0 comments on commit 31b7743

Please sign in to comment.