<commit_before>"""Tests for the set of functions defined in compressor.functions"""
import sys

from compressor.functions import endianess_prefix


def test_endianess_prefix_bigendinan(monkeypatch):
    monkeypatch.setattr(sys, 'byteorder', 'big')
    assert endianess_prefix() == '>'


def test_endianess_prefix_bytes(monkeypatch):
    monkeypatch.setattr(sys, 'byteorder', 'big')
    assert endianess_prefix(bytes) == b'>'<commit_msg>tests: Add test for pack/unpack<commit_after>"""Tests for the set of functions defined in compressor.functions"""
import sys

from compressor.functions import endianess_prefix, pack, unpack


def test_endianess_prefix_bigendinan(monkeypatch):
    monkeypatch.setattr(sys, 'byteorder', 'big')
    assert endianess_prefix() == '>'


def test_endianess_prefix_bytes(monkeypatch):
    monkeypatch.setattr(sys, 'byteorder', 'big')
    assert endianess_prefix(bytes) == b'>'


def test_packing(monkeypatch):
    monkeypatch.setattr(sys, 'byteorder', 'big')

    buffer = pack('i', 42)
    data, = unpack('i', buffer)
    assert data == 42
{'fraction_non_alphanumeric': 0.12078651685393259, 'fraction_numerical': 0.003745318352059925, 'mean_word_length': 5.723270440251572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4485314', 'n_tokens_mistral': 368, 'n_tokens_neox': 341, 'n_words': 79}