def test_switch_start_protocol_calls_startup_callbacks(self): s = Switch(ipp=selfipp) s.send = Mock() s.startup_callbacks = self.four_callbacks s.startProtocol() assert s.send.call_count == 4 assert all(map(self.has_telex_and_to, s.send.call_args_list))
def test_switch_start_protocol_sends_bootstrap_telex_under_correct_conditions(self): s_should_send = Switch(seed_ipp=faripp) s_should_send.send = Mock() s_should_send.startProtocol() assert s_should_send.send.called s_should_not_send = Switch() s_should_not_send.ipp = selfipp s_should_not_send.send = Mock() s_should_not_send.startProtocol() assert not s_should_not_send.send.called