def test_is_enode_online_return(mocker): valid_hosts = ['REG_SA_Telsius_2_4_00', 'REG_SEAT_T_2_16_01'] mocker.patch.object( NodeValidator, 'get_valid_hosts_from_external_source', return_value=valid_hosts) node_info = NodeInformation( '1.2.3.4', 'myenode', 'REG_SA_Telsius_2_4_00') validator = NodeValidator(node_info) validator.use_enode_request_config(EnodeRequestConfig()) is_valid = validator.is_enode_online() assert is_valid
def test_is_enode_online_empty_hosts_false(mocker): valid_hosts = [] mocker.patch.object( NodeValidator, 'get_valid_hosts_from_external_source', return_value=valid_hosts) node_info = NodeInformation( '1.2.3.4', 'myenode', 'myhostname') validator = NodeValidator(node_info) validator.use_enode_request_config(EnodeRequestConfig()) is_valid = validator.is_enode_online() assert not is_valid