<commit_before># Filename: test_loan.py

"""
Test the lendingclub2.loan module
"""

# Standard libraries
import collections

# lendingclub2
from lendingclub2 import loan


class TestListing(object):
    def test_search(self):
        listing = loan.Listing()
        listing.search()<commit_msg>Skip test for searching loan if cannot find auth key<commit_after># Filename: test_loan.py

"""
Test the lendingclub2.loan module
"""

# Standard libraries
import collections

# PyTest
import pytest

# lendingclub2
from lendingclub2 import loan
from lendingclub2.authorization import Authorization
from lendingclub2.error import LCError


class TestListing(object):
    def test_search(self):
        try:
            _ = Authorization.key
        except LCError:
            pytest.skip("skip test: cannot find authorization key")

        listing = loan.Listing()
        listing.search()
{'fraction_non_alphanumeric': 0.07796610169491526, 'fraction_numerical': 0.00903954802259887, 'mean_word_length': 3.6145833333333335, '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': '3349286', 'n_tokens_mistral': 261, 'n_tokens_neox': 244, 'n_words': 77}