<commit_before><commit_msg>add test for PROPAGATE message<commit_after>import pytest
from plenum.common.types import Propagate, ClientMessageValidator
from collections import OrderedDict
from plenum.common.messages.fields import NonNegativeNumberField, \
    LedgerIdField, MerkleRootField, IterableField, NonEmptyStringField, \
    TimestampField, HexField

EXPECTED_ORDERED_FIELDS = OrderedDict([
    ("request", ClientMessageValidator),
    ("senderClient", NonEmptyStringField),
])


def test_hash_expected_type():
    assert Propagate.typename == "PROPAGATE"


def test_has_expected_fields():
    actual_field_names = OrderedDict(Propagate.schema).keys()
    assert actual_field_names == EXPECTED_ORDERED_FIELDS.keys()


def test_has_expected_validators():
    schema = dict(Propagate.schema)
    for field, validator in EXPECTED_ORDERED_FIELDS.items():
        assert isinstance(schema[field], validator)

{'fraction_non_alphanumeric': 0.0845225027442371, 'fraction_numerical': 0.0, 'mean_word_length': 6.125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6818228', 'n_tokens_mistral': 273, 'n_tokens_neox': 269, 'n_words': 55}