def test_null_does_not_match_payload(): assert matches_payload(None) is False
def test_payload_does_match_data_when_version_is_missing(): data = {'protocol': 'mega'} assert matches_payload(data) is False
def test_payload_does_match_data_when_protocol_is_missing(): data = {'version': 1} assert matches_payload(data) is False
def test_payload_does_not_match_data_when_version_is(version): data = {'protocol': 'mega', 'version': version} assert matches_payload(data) is False
def test_payload_does_not_match_data_when_protocol_is(protocol): data = {'protocol': protocol, 'version': 1} assert matches_payload(data) is False
def test_payload_matches_data_when_protocol_and_version_match(): data = {'protocol': 'mega', 'version': 1} assert matches_payload(data) is True