From db7b24086faeb066e7dfcc4831f03beac3316f96 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 2 Mar 2017 23:59:24 -0800 Subject: [PATCH] set no-cover on all state-definition lines, and set_trace --- src/wormhole/_boss.py | 12 ++++++------ src/wormhole/_code.py | 14 +++++++------- src/wormhole/_key.py | 10 +++++----- src/wormhole/_mailbox.py | 18 +++++++++--------- src/wormhole/_nameplate.py | 22 +++++++++++----------- src/wormhole/_nameplate_lister.py | 10 +++++----- src/wormhole/_order.py | 6 +++--- src/wormhole/_receive.py | 10 +++++----- src/wormhole/_send.py | 6 +++--- src/wormhole/_terminator.py | 20 ++++++++++---------- 10 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/wormhole/_boss.py b/src/wormhole/_boss.py index 3d5794d..3e1a843 100644 --- a/src/wormhole/_boss.py +++ b/src/wormhole/_boss.py @@ -32,7 +32,7 @@ class Boss(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._N = Nameplate() @@ -83,15 +83,15 @@ class Boss(object): # and these are the state-machine transition functions, which don't take # args @m.state(initial=True) - def S0_empty(self): pass + def S0_empty(self): pass # pragma: no cover @m.state() - def S1_lonely(self): pass + def S1_lonely(self): pass # pragma: no cover @m.state() - def S2_happy(self): pass + def S2_happy(self): pass # pragma: no cover @m.state() - def S3_closing(self): pass + def S3_closing(self): pass # pragma: no cover @m.state(terminal=True) - def S4_closed(self): pass + def S4_closed(self): pass # pragma: no cover # from the Wormhole diff --git a/src/wormhole/_code.py b/src/wormhole/_code.py index 3dab38c..b483f07 100644 --- a/src/wormhole/_code.py +++ b/src/wormhole/_code.py @@ -26,7 +26,7 @@ class Code(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def wire(self, boss, rendezvous_connector, nameplate_lister): self._B = _interfaces.IBoss(boss) @@ -34,17 +34,17 @@ class Code(object): self._NL = _interfaces.INameplateLister(nameplate_lister) @m.state(initial=True) - def S0_unknown(self): pass + def S0_unknown(self): pass # pragma: no cover @m.state() - def S1A_connecting(self): pass + def S1A_connecting(self): pass # pragma: no cover @m.state() - def S1B_allocating(self): pass + def S1B_allocating(self): pass # pragma: no cover @m.state() - def S2_typing_nameplate(self): pass + def S2_typing_nameplate(self): pass # pragma: no cover @m.state() - def S3_typing_code(self): pass + def S3_typing_code(self): pass # pragma: no cover @m.state() - def S4_known(self): pass + def S4_known(self): pass # pragma: no cover # from App @m.input() diff --git a/src/wormhole/_key.py b/src/wormhole/_key.py index 49fa9e2..e5f54fd 100644 --- a/src/wormhole/_key.py +++ b/src/wormhole/_key.py @@ -60,7 +60,7 @@ class Key(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def wire(self, boss, mailbox, receive): self._B = _interfaces.IBoss(boss) @@ -68,13 +68,13 @@ class Key(object): self._R = _interfaces.IReceive(receive) @m.state(initial=True) - def S0_know_nothing(self): pass + def S0_know_nothing(self): pass # pragma: no cover @m.state() - def S1_know_code(self): pass + def S1_know_code(self): pass # pragma: no cover @m.state() - def S2_know_key(self): pass + def S2_know_key(self): pass # pragma: no cover @m.state(terminal=True) - def S3_scared(self): pass + def S3_scared(self): pass # pragma: no cover # from Boss @m.input() diff --git a/src/wormhole/_mailbox.py b/src/wormhole/_mailbox.py index db7de74..958d6f8 100644 --- a/src/wormhole/_mailbox.py +++ b/src/wormhole/_mailbox.py @@ -11,7 +11,7 @@ class Mailbox(object): _side = attrib(validator=instance_of(type(u""))) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._mailbox = None @@ -30,27 +30,27 @@ class Mailbox(object): # S0: know nothing @m.state(initial=True) - def S0A(self): pass + def S0A(self): pass # pragma: no cover @m.state() - def S0B(self): pass + def S0B(self): pass # pragma: no cover # S1: mailbox known, not opened @m.state() - def S1A(self): pass + def S1A(self): pass # pragma: no cover # S2: mailbox known, opened # 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() @m.state() - def S2A(self): pass + def S2A(self): pass # pragma: no cover @m.state() - def S2B(self): pass + def S2B(self): pass # pragma: no cover # S3: closing @m.state() - def S3A(self): pass + def S3A(self): pass # pragma: no cover @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 #@m.state() @@ -58,7 +58,7 @@ class Mailbox(object): #@m.state() #def S4B(self): pass @m.state(terminal=True) - def S4(self): pass + def S4(self): pass # pragma: no cover S4A = S4 S4B = S4 diff --git a/src/wormhole/_nameplate.py b/src/wormhole/_nameplate.py index a33cdde..777098d 100644 --- a/src/wormhole/_nameplate.py +++ b/src/wormhole/_nameplate.py @@ -7,7 +7,7 @@ from . import _interfaces class Nameplate(object): m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __init__(self): self._nameplate = None @@ -23,31 +23,31 @@ class Nameplate(object): # S0: know nothing @m.state(initial=True) - def S0A(self): pass + def S0A(self): pass # pragma: no cover @m.state() - def S0B(self): pass + def S0B(self): pass # pragma: no cover # S1: nameplate known, never claimed @m.state() - def S1A(self): pass + def S1A(self): pass # pragma: no cover # S2: nameplate known, maybe claimed @m.state() - def S2A(self): pass + def S2A(self): pass # pragma: no cover @m.state() - def S2B(self): pass + def S2B(self): pass # pragma: no cover # S3: nameplate claimed @m.state() - def S3A(self): pass + def S3A(self): pass # pragma: no cover @m.state() - def S3B(self): pass + def S3B(self): pass # pragma: no cover # S4: maybe released @m.state() - def S4A(self): pass + def S4A(self): pass # pragma: no cover @m.state() - def S4B(self): pass + def S4B(self): pass # pragma: no cover # S5: released # we no longer care whether we're connected or not @@ -56,7 +56,7 @@ class Nameplate(object): #@m.state() #def S5B(self): pass @m.state() - def S5(self): pass + def S5(self): pass # pragma: no cover S5A = S5 S5B = S5 diff --git a/src/wormhole/_nameplate_lister.py b/src/wormhole/_nameplate_lister.py index 27d064c..e40e406 100644 --- a/src/wormhole/_nameplate_lister.py +++ b/src/wormhole/_nameplate_lister.py @@ -7,7 +7,7 @@ from . import _interfaces class NameplateListing(object): m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def wire(self, rendezvous_connector, code): self._RC = _interfaces.IRendezvousConnector(rendezvous_connector) @@ -23,13 +23,13 @@ class NameplateListing(object): # request arrives, both requests will be satisfied by the same response. @m.state(initial=True) - def S0A_idle_disconnected(self): pass + def S0A_idle_disconnected(self): pass # pragma: no cover @m.state() - def S1A_wanting_disconnected(self): pass + def S1A_wanting_disconnected(self): pass # pragma: no cover @m.state() - def S0B_idle_connected(self): pass + def S0B_idle_connected(self): pass # pragma: no cover @m.state() - def S1B_wanting_connected(self): pass + def S1B_wanting_connected(self): pass # pragma: no cover @m.input() def connected(self): pass diff --git a/src/wormhole/_order.py b/src/wormhole/_order.py index c4df241..81cb088 100644 --- a/src/wormhole/_order.py +++ b/src/wormhole/_order.py @@ -12,7 +12,7 @@ class Order(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._key = None @@ -22,9 +22,9 @@ class Order(object): self._R = _interfaces.IReceive(receive) @m.state(initial=True) - def S0_no_pake(self): pass + def S0_no_pake(self): pass # pragma: no cover @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): #print("ORDER[%s].got_message(%s)" % (self._side, phase)) diff --git a/src/wormhole/_receive.py b/src/wormhole/_receive.py index 8445756..83dc92a 100644 --- a/src/wormhole/_receive.py +++ b/src/wormhole/_receive.py @@ -13,7 +13,7 @@ class Receive(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._key = None @@ -24,13 +24,13 @@ class Receive(object): self._S = _interfaces.ISend(send) @m.state(initial=True) - def S0_unknown_key(self): pass + def S0_unknown_key(self): pass # pragma: no cover @m.state() - def S1_unverified_key(self): pass + def S1_unverified_key(self): pass # pragma: no cover @m.state() - def S2_verified_key(self): pass + def S2_verified_key(self): pass # pragma: no cover @m.state(terminal=True) - def S3_scared(self): pass + def S3_scared(self): pass # pragma: no cover # from Ordering def got_message(self, side, phase, body): diff --git a/src/wormhole/_send.py b/src/wormhole/_send.py index 76617a3..ccd4699 100644 --- a/src/wormhole/_send.py +++ b/src/wormhole/_send.py @@ -13,7 +13,7 @@ class Send(object): _timing = attrib(validator=provides(_interfaces.ITiming)) m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._queue = [] @@ -22,9 +22,9 @@ class Send(object): self._M = _interfaces.IMailbox(mailbox) @m.state(initial=True) - def S0_no_key(self): pass + def S0_no_key(self): pass # pragma: no cover @m.state(terminal=True) - def S1_verified_key(self): pass + def S1_verified_key(self): pass # pragma: no cover # from Receive @m.input() diff --git a/src/wormhole/_terminator.py b/src/wormhole/_terminator.py index d764a05..f7da3cc 100644 --- a/src/wormhole/_terminator.py +++ b/src/wormhole/_terminator.py @@ -7,7 +7,7 @@ from . import _interfaces class Terminator(object): m = MethodicalMachine() @m.setTrace() - def set_trace(): pass + def set_trace(): pass # pragma: no cover def __attrs_post_init__(self): self._mood = None @@ -30,27 +30,27 @@ class Terminator(object): # done, and we're closing, then we stop the RendezvousConnector @m.state(initial=True) - def Snmo(self): pass + def Snmo(self): pass # pragma: no cover @m.state() - def Smo(self): pass + def Smo(self): pass # pragma: no cover @m.state() - def Sno(self): pass + def Sno(self): pass # pragma: no cover @m.state() - def S0o(self): pass + def S0o(self): pass # pragma: no cover @m.state() - def Snm(self): pass + def Snm(self): pass # pragma: no cover @m.state() - def Sm(self): pass + def Sm(self): pass # pragma: no cover @m.state() - def Sn(self): pass + def Sn(self): pass # pragma: no cover #@m.state() #def S0(self): pass # unused @m.state() - def S_stopping(self): pass + def S_stopping(self): pass # pragma: no cover @m.state() - def S_stopped(self, terminal=True): pass + def S_stopped(self, terminal=True): pass # pragma: no cover # from Boss @m.input()