<commit_before>import pytest

import pgpy
from pgpy.pgpdump import PGPDumpFormat

keys = [
    "tests/testdata/testkeys.gpg",
    "tests/testdata/testkeys.sec.gpg",
    ["tests/testdata/testkeys.gpg", "tests/testdata/testkeys.sec.gpg"]
]
keyids = [
    "testkeys",
    "testkeys-sec",
    "testkeys-both",
]
@pytest.fixture(params=keys, ids=keyids)
def load_key(request):
    return request.param


class TestPGPKeyLoader:
    def test_load(self, load_key, pgpdump):
        with pgpy.PGPKeyCollection(load_key) as k:
            assert '\n'.join(PGPDumpFormat(k).out) + '\n' == pgpdump.decode()

    def test_bytes(self, load_key):
        with pgpy.PGPKeyCollection(load_key) as k:
            fb = b''.join([open(f, 'rb').read() for f in load_key]) if type(load_key) is list else open(load_key, 'rb').read()

            assert k.__bytes__() == fb<commit_msg>added/commented some test stubs<commit_after>import pytest

import pgpy
from pgpy.pgpdump import PGPDumpFormat

keys = [
    "tests/testdata/testkeys.gpg",
    "tests/testdata/testkeys.sec.gpg",
    ["tests/testdata/testkeys.gpg", "tests/testdata/testkeys.sec.gpg"]
]
keyids = [
    "testkeys",
    "testkeys-sec",
    "testkeys-both",
]
@pytest.fixture(params=keys, ids=keyids)
def load_key(request):
    return request.param


class TestPGPKeyLoader:
    def test_load(self, load_key, pgpdump):
        with pgpy.PGPKeyCollection(load_key) as k:
            assert '\n'.join(PGPDumpFormat(k).out) + '\n' == pgpdump.decode()

    def test_bytes(self, load_key):
        with pgpy.PGPKeyCollection(load_key) as k:
            fb = b''.join([open(f, 'rb').read() for f in load_key]) if type(load_key) is list else open(load_key, 'rb').read()

            assert k.__bytes__() == fb

    # def test_list_pubkeys(self, load_key):
    #     pass

    # def test_list_privkeys(self, load_key):
    #     pass

    def test_str(self, load_key):
        with pgpy.PGPKeyCollection(load_key) as k:
            pass
{'fraction_non_alphanumeric': 0.13871951219512196, 'fraction_numerical': 0.0, 'mean_word_length': 3.2344086021505376, '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': '2244837', 'n_tokens_mistral': 725, 'n_tokens_neox': 715, 'n_words': 140}