Test for case where Ursula knows nobody. Currently forced to fail. See #630.

pull/632/head
jMyles 2018-12-19 20:15:34 -05:00
parent 9fc72187ec
commit bf0a9e702b
1 changed files with 16 additions and 0 deletions

View File

@ -1,8 +1,24 @@
from constant_sorrow.constants import FLEET_STATES_MATCH
from hendrix.experience import crosstown_traffic
from hendrix.utils.test_utils import crosstownTaskListDecoratorFactory
from nucypher.utilities.sandbox.ursula import make_federated_ursulas
from functools import partial
def test_learning_from_node_with_no_known_nodes(ursula_federated_test_config):
lonely_ursula_maker = partial(make_federated_ursulas,
ursula_config=ursula_federated_test_config,
quantity=1,
know_each_other=False)
lonely_teacher = lonely_ursula_maker().pop()
lonely_learner = lonely_ursula_maker(known_nodes=[lonely_teacher]).pop()
learning_callers = []
crosstown_traffic.decorator = crosstownTaskListDecoratorFactory(learning_callers)
result = lonely_learner.learn_from_teacher_node()
assert False
def test_all_nodes_have_same_fleet_state(federated_ursulas):
checksums = [u.known_nodes.checksum for u in federated_ursulas]
assert len(set(checksums)) == 1 # There is only 1 unique value.