def checkViewNoForNodes(nodes: Iterable[TestNode], expectedViewNo: int=None):
    '\n    Checks if all the given nodes have the expected view no\n\n    :param nodes: The nodes to check for\n    :param expectedViewNo: the view no that the nodes are expected to have\n    :return:\n    '
    viewNos = set()
    for node in nodes:
        logger.debug("{}'s view no is {}".format(node, node.master_replica.viewNo))
        viewNos.add(node.master_replica.viewNo)
    assert (len(viewNos) == 1), 'Expected 1, but got {}. ViewNos: {}'.format(len(viewNos), [(n.name, n.master_replica.viewNo) for n in nodes])
    (vNo,) = viewNos
    if (expectedViewNo is not None):
        assert (vNo >= expectedViewNo), 'Expected at least {}, but got {}'.format(expectedViewNo, vNo)
    return vNo
Checks if all the given nodes have the expected view no

:param nodes: The nodes to check for
:param expectedViewNo: the view no that the nodes are expected to have
:return:
def checkViewNoForNodes(nodes: Iterable[TestNode], expectedViewNo: int=None):
    '\n    Checks if all the given nodes have the expected view no\n\n    :param nodes: The nodes to check for\n    :param expectedViewNo: the view no that the nodes are expected to have\n    :return:\n    '
    viewNos = set()
    for node in nodes:
        logger.debug("{}'s view no is {}".format(node, node.master_replica.viewNo))
        viewNos.add(node.master_replica.viewNo)
    assert (len(viewNos) == 1), 'Expected 1, but got {}. ViewNos: {}'.format(len(viewNos), [(n.name, n.master_replica.viewNo) for n in nodes])
    (vNo,) = viewNos
    if (expectedViewNo is not None):
        assert (vNo >= expectedViewNo), 'Expected at least {}, but got {}'.format(expectedViewNo, vNo)
    return vNo