Code: deliver got_code to Boss before Key

So when Key sends got_key to Boss, Boss will be ready for it

test_machines: match new delivery order
This commit is contained in:
Brian Warner 2017-03-22 16:09:30 -07:00
parent 0ed363c894
commit b38d4c94ca
2 changed files with 7 additions and 7 deletions

View File

@ -56,8 +56,8 @@ class Code(object):
def do_set_code(self, code):
nameplate = code.split("-", 2)[0]
self._N.set_nameplate(nameplate)
self._K.got_code(code)
self._B.got_code(code)
self._K.got_code(code)
@m.output()
def do_start_input(self):
@ -67,8 +67,8 @@ class Code(object):
self._N.set_nameplate(nameplate)
@m.output()
def do_finish_input(self, code):
self._K.got_code(code)
self._B.got_code(code)
self._K.got_code(code)
@m.output()
def do_start_allocate(self, length, wordlist):
@ -77,8 +77,8 @@ class Code(object):
def do_finish_allocate(self, nameplate, code):
assert code.startswith(nameplate+"-"), (nameplate, code)
self._N.set_nameplate(nameplate)
self._K.got_code(code)
self._B.got_code(code)
self._K.got_code(code)
S0_idle.upon(set_code, enter=S4_known, outputs=[do_set_code])
S0_idle.upon(input_code, enter=S1_inputting_nameplate,

View File

@ -273,8 +273,8 @@ class Code(unittest.TestCase):
c, b, a, n, k, i, events = self.build()
c.set_code(u"1-code")
self.assertEqual(events, [("n.set_nameplate", u"1"),
("k.got_code", u"1-code"),
("b.got_code", u"1-code"),
("k.got_code", u"1-code"),
])
def test_allocate_code(self):
@ -285,8 +285,8 @@ class Code(unittest.TestCase):
events[:] = []
c.allocated("1", "1-code")
self.assertEqual(events, [("n.set_nameplate", u"1"),
("k.got_code", u"1-code"),
("b.got_code", u"1-code"),
("k.got_code", u"1-code"),
])
def test_input_code(self):
@ -299,8 +299,8 @@ class Code(unittest.TestCase):
])
events[:] = []
c.finished_input("1-code")
self.assertEqual(events, [("k.got_code", u"1-code"),
("b.got_code", u"1-code"),
self.assertEqual(events, [("b.got_code", u"1-code"),
("k.got_code", u"1-code"),
])
class Input(unittest.TestCase):