<commit_before>import os.path

from pyrpm.spec import Package, Spec, replace_macros

CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))


class TestPackageClass:
    def test_repr_string(self):
        package = Package('foo')
        assert package.name == 'foo'
        assert str(package) == "Package('foo')"

    def test_is_subpackage(self):
        package = Package('foo')
        assert package.is_subpackage is False


class TestSpecFileParser:
    def test_parse_perl_array_compare_spec(self):
        spec = Spec.from_file(os.path.join(CURRENT_DIR, 'perl-Array-Compare.spec'))
        assert isinstance(spec, Spec)

        assert 'perl-Array-Compare' == spec.name
        assert 'Perl extension for comparing arrays' == spec.summary
        assert 1 == spec.epoch

        assert '1.16' == spec.version
        assert 'noarch' == spec.buildarch
        assert 2 == len(spec.build_requires)
        assert 'perl >= 1:5.6.0' == spec.build_requires[0].line<commit_msg>Amend c769c34<commit_after>import os.path

from pyrpm.spec import Package, Spec, replace_macros

CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))


class TestPackageClass:
    def test_repr_string(self):
        package = Package('foo')
        assert package.name == 'foo'
        assert str(package) == "Package('foo')"

    def test_is_subpackage(self):
        package = Package('foo')
        assert package.is_subpackage is False


class TestSpecFileParser:
    def test_parse_perl_array_compare_spec(self):
        spec = Spec.from_file(os.path.join(CURRENT_DIR, 'perl-Array-Compare.spec'))
        assert isinstance(spec, Spec)

        assert 'perl-Array-Compare' == spec.name
        assert 'Perl extension for comparing arrays' == spec.summary
        assert '1' == spec.epoch

        assert '1.16' == spec.version
        assert 'noarch' == spec.buildarch
        assert 2 == len(spec.build_requires)
        assert 'perl >= 1:5.6.0' == spec.build_requires[0].line
{'fraction_non_alphanumeric': 0.116751269035533, 'fraction_numerical': 0.012690355329949238, 'mean_word_length': 3.10625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '947177', 'n_tokens_mistral': 628, 'n_tokens_neox': 596, 'n_words': 132}