set no-cover on all state-definition lines, and set_trace

This commit is contained in:
Brian Warner 2017-03-02 23:59:24 -08:00
parent 610db612ba
commit db7b24086f
10 changed files with 64 additions and 64 deletions

View File

@ -32,7 +32,7 @@ class Boss(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._N = Nameplate() self._N = Nameplate()
@ -83,15 +83,15 @@ class Boss(object):
# and these are the state-machine transition functions, which don't take # and these are the state-machine transition functions, which don't take
# args # args
@m.state(initial=True) @m.state(initial=True)
def S0_empty(self): pass def S0_empty(self): pass # pragma: no cover
@m.state() @m.state()
def S1_lonely(self): pass def S1_lonely(self): pass # pragma: no cover
@m.state() @m.state()
def S2_happy(self): pass def S2_happy(self): pass # pragma: no cover
@m.state() @m.state()
def S3_closing(self): pass def S3_closing(self): pass # pragma: no cover
@m.state(terminal=True) @m.state(terminal=True)
def S4_closed(self): pass def S4_closed(self): pass # pragma: no cover
# from the Wormhole # from the Wormhole

View File

@ -26,7 +26,7 @@ class Code(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def wire(self, boss, rendezvous_connector, nameplate_lister): def wire(self, boss, rendezvous_connector, nameplate_lister):
self._B = _interfaces.IBoss(boss) self._B = _interfaces.IBoss(boss)
@ -34,17 +34,17 @@ class Code(object):
self._NL = _interfaces.INameplateLister(nameplate_lister) self._NL = _interfaces.INameplateLister(nameplate_lister)
@m.state(initial=True) @m.state(initial=True)
def S0_unknown(self): pass def S0_unknown(self): pass # pragma: no cover
@m.state() @m.state()
def S1A_connecting(self): pass def S1A_connecting(self): pass # pragma: no cover
@m.state() @m.state()
def S1B_allocating(self): pass def S1B_allocating(self): pass # pragma: no cover
@m.state() @m.state()
def S2_typing_nameplate(self): pass def S2_typing_nameplate(self): pass # pragma: no cover
@m.state() @m.state()
def S3_typing_code(self): pass def S3_typing_code(self): pass # pragma: no cover
@m.state() @m.state()
def S4_known(self): pass def S4_known(self): pass # pragma: no cover
# from App # from App
@m.input() @m.input()

View File

@ -60,7 +60,7 @@ class Key(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def wire(self, boss, mailbox, receive): def wire(self, boss, mailbox, receive):
self._B = _interfaces.IBoss(boss) self._B = _interfaces.IBoss(boss)
@ -68,13 +68,13 @@ class Key(object):
self._R = _interfaces.IReceive(receive) self._R = _interfaces.IReceive(receive)
@m.state(initial=True) @m.state(initial=True)
def S0_know_nothing(self): pass def S0_know_nothing(self): pass # pragma: no cover
@m.state() @m.state()
def S1_know_code(self): pass def S1_know_code(self): pass # pragma: no cover
@m.state() @m.state()
def S2_know_key(self): pass def S2_know_key(self): pass # pragma: no cover
@m.state(terminal=True) @m.state(terminal=True)
def S3_scared(self): pass def S3_scared(self): pass # pragma: no cover
# from Boss # from Boss
@m.input() @m.input()

View File

@ -11,7 +11,7 @@ class Mailbox(object):
_side = attrib(validator=instance_of(type(u""))) _side = attrib(validator=instance_of(type(u"")))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._mailbox = None self._mailbox = None
@ -30,27 +30,27 @@ class Mailbox(object):
# S0: know nothing # S0: know nothing
@m.state(initial=True) @m.state(initial=True)
def S0A(self): pass def S0A(self): pass # pragma: no cover
@m.state() @m.state()
def S0B(self): pass def S0B(self): pass # pragma: no cover
# S1: mailbox known, not opened # S1: mailbox known, not opened
@m.state() @m.state()
def S1A(self): pass def S1A(self): pass # pragma: no cover
# S2: mailbox known, opened # S2: mailbox known, opened
# We've definitely tried to open the mailbox at least once, but it must # We've definitely tried to open the mailbox at least once, but it must
# be re-opened with each connection, because open() is also subscribe() # be re-opened with each connection, because open() is also subscribe()
@m.state() @m.state()
def S2A(self): pass def S2A(self): pass # pragma: no cover
@m.state() @m.state()
def S2B(self): pass def S2B(self): pass # pragma: no cover
# S3: closing # S3: closing
@m.state() @m.state()
def S3A(self): pass def S3A(self): pass # pragma: no cover
@m.state() @m.state()
def S3B(self): pass def S3B(self): pass # pragma: no cover
# S4: closed. We no longer care whether we're connected or not # S4: closed. We no longer care whether we're connected or not
#@m.state() #@m.state()
@ -58,7 +58,7 @@ class Mailbox(object):
#@m.state() #@m.state()
#def S4B(self): pass #def S4B(self): pass
@m.state(terminal=True) @m.state(terminal=True)
def S4(self): pass def S4(self): pass # pragma: no cover
S4A = S4 S4A = S4
S4B = S4 S4B = S4

View File

@ -7,7 +7,7 @@ from . import _interfaces
class Nameplate(object): class Nameplate(object):
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __init__(self): def __init__(self):
self._nameplate = None self._nameplate = None
@ -23,31 +23,31 @@ class Nameplate(object):
# S0: know nothing # S0: know nothing
@m.state(initial=True) @m.state(initial=True)
def S0A(self): pass def S0A(self): pass # pragma: no cover
@m.state() @m.state()
def S0B(self): pass def S0B(self): pass # pragma: no cover
# S1: nameplate known, never claimed # S1: nameplate known, never claimed
@m.state() @m.state()
def S1A(self): pass def S1A(self): pass # pragma: no cover
# S2: nameplate known, maybe claimed # S2: nameplate known, maybe claimed
@m.state() @m.state()
def S2A(self): pass def S2A(self): pass # pragma: no cover
@m.state() @m.state()
def S2B(self): pass def S2B(self): pass # pragma: no cover
# S3: nameplate claimed # S3: nameplate claimed
@m.state() @m.state()
def S3A(self): pass def S3A(self): pass # pragma: no cover
@m.state() @m.state()
def S3B(self): pass def S3B(self): pass # pragma: no cover
# S4: maybe released # S4: maybe released
@m.state() @m.state()
def S4A(self): pass def S4A(self): pass # pragma: no cover
@m.state() @m.state()
def S4B(self): pass def S4B(self): pass # pragma: no cover
# S5: released # S5: released
# we no longer care whether we're connected or not # we no longer care whether we're connected or not
@ -56,7 +56,7 @@ class Nameplate(object):
#@m.state() #@m.state()
#def S5B(self): pass #def S5B(self): pass
@m.state() @m.state()
def S5(self): pass def S5(self): pass # pragma: no cover
S5A = S5 S5A = S5
S5B = S5 S5B = S5

View File

@ -7,7 +7,7 @@ from . import _interfaces
class NameplateListing(object): class NameplateListing(object):
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def wire(self, rendezvous_connector, code): def wire(self, rendezvous_connector, code):
self._RC = _interfaces.IRendezvousConnector(rendezvous_connector) self._RC = _interfaces.IRendezvousConnector(rendezvous_connector)
@ -23,13 +23,13 @@ class NameplateListing(object):
# request arrives, both requests will be satisfied by the same response. # request arrives, both requests will be satisfied by the same response.
@m.state(initial=True) @m.state(initial=True)
def S0A_idle_disconnected(self): pass def S0A_idle_disconnected(self): pass # pragma: no cover
@m.state() @m.state()
def S1A_wanting_disconnected(self): pass def S1A_wanting_disconnected(self): pass # pragma: no cover
@m.state() @m.state()
def S0B_idle_connected(self): pass def S0B_idle_connected(self): pass # pragma: no cover
@m.state() @m.state()
def S1B_wanting_connected(self): pass def S1B_wanting_connected(self): pass # pragma: no cover
@m.input() @m.input()
def connected(self): pass def connected(self): pass

View File

@ -12,7 +12,7 @@ class Order(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._key = None self._key = None
@ -22,9 +22,9 @@ class Order(object):
self._R = _interfaces.IReceive(receive) self._R = _interfaces.IReceive(receive)
@m.state(initial=True) @m.state(initial=True)
def S0_no_pake(self): pass def S0_no_pake(self): pass # pragma: no cover
@m.state(terminal=True) @m.state(terminal=True)
def S1_yes_pake(self): pass def S1_yes_pake(self): pass # pragma: no cover
def got_message(self, side, phase, body): def got_message(self, side, phase, body):
#print("ORDER[%s].got_message(%s)" % (self._side, phase)) #print("ORDER[%s].got_message(%s)" % (self._side, phase))

View File

@ -13,7 +13,7 @@ class Receive(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._key = None self._key = None
@ -24,13 +24,13 @@ class Receive(object):
self._S = _interfaces.ISend(send) self._S = _interfaces.ISend(send)
@m.state(initial=True) @m.state(initial=True)
def S0_unknown_key(self): pass def S0_unknown_key(self): pass # pragma: no cover
@m.state() @m.state()
def S1_unverified_key(self): pass def S1_unverified_key(self): pass # pragma: no cover
@m.state() @m.state()
def S2_verified_key(self): pass def S2_verified_key(self): pass # pragma: no cover
@m.state(terminal=True) @m.state(terminal=True)
def S3_scared(self): pass def S3_scared(self): pass # pragma: no cover
# from Ordering # from Ordering
def got_message(self, side, phase, body): def got_message(self, side, phase, body):

View File

@ -13,7 +13,7 @@ class Send(object):
_timing = attrib(validator=provides(_interfaces.ITiming)) _timing = attrib(validator=provides(_interfaces.ITiming))
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._queue = [] self._queue = []
@ -22,9 +22,9 @@ class Send(object):
self._M = _interfaces.IMailbox(mailbox) self._M = _interfaces.IMailbox(mailbox)
@m.state(initial=True) @m.state(initial=True)
def S0_no_key(self): pass def S0_no_key(self): pass # pragma: no cover
@m.state(terminal=True) @m.state(terminal=True)
def S1_verified_key(self): pass def S1_verified_key(self): pass # pragma: no cover
# from Receive # from Receive
@m.input() @m.input()

View File

@ -7,7 +7,7 @@ from . import _interfaces
class Terminator(object): class Terminator(object):
m = MethodicalMachine() m = MethodicalMachine()
@m.setTrace() @m.setTrace()
def set_trace(): pass def set_trace(): pass # pragma: no cover
def __attrs_post_init__(self): def __attrs_post_init__(self):
self._mood = None self._mood = None
@ -30,27 +30,27 @@ class Terminator(object):
# done, and we're closing, then we stop the RendezvousConnector # done, and we're closing, then we stop the RendezvousConnector
@m.state(initial=True) @m.state(initial=True)
def Snmo(self): pass def Snmo(self): pass # pragma: no cover
@m.state() @m.state()
def Smo(self): pass def Smo(self): pass # pragma: no cover
@m.state() @m.state()
def Sno(self): pass def Sno(self): pass # pragma: no cover
@m.state() @m.state()
def S0o(self): pass def S0o(self): pass # pragma: no cover
@m.state() @m.state()
def Snm(self): pass def Snm(self): pass # pragma: no cover
@m.state() @m.state()
def Sm(self): pass def Sm(self): pass # pragma: no cover
@m.state() @m.state()
def Sn(self): pass def Sn(self): pass # pragma: no cover
#@m.state() #@m.state()
#def S0(self): pass # unused #def S0(self): pass # unused
@m.state() @m.state()
def S_stopping(self): pass def S_stopping(self): pass # pragma: no cover
@m.state() @m.state()
def S_stopped(self, terminal=True): pass def S_stopped(self, terminal=True): pass # pragma: no cover
# from Boss # from Boss
@m.input() @m.input()