<commit_before>import os
from rhcephpkg import Download
from rhcephpkg.tests.util import fake_urlopen


class TestDownload(object):

    def test_basic_download(self, monkeypatch, tmpdir):
        monkeypatch.setattr('rhcephpkg.download.urlopen', fake_urlopen)
        monkeypatch.chdir(tmpdir)
        download = Download([])
        download._run('ceph_10.2.0-2redhat1trusty')
        expected = [
            'ceph_10.2.0-2redhat1trusty.debian.tar.gz',
            'ceph_10.2.0-2redhat1trusty.dsc',
            'ceph_10.2.0-2redhat1trusty_amd64.changes',
            'ceph_10.2.0.orig.tar.gz',
            'libcephfs1-dbg_10.2.0-2redhat1trusty_amd64.deb',
            'librbd-dbg_10.2.0-2redhat1trusty_amd64.deb',
            'ceph_10.2.0-2redhat1trusty_amd64.deb',
            'radosgw_10.2.0-2redhat1trusty_amd64.deb',
            'libcephfs-java_10.2.0-2redhat1trusty_all.deb',
        ]
        for binary in expected:
            assert os.path.isfile(binary)<commit_msg>tests: run Download's main() method<commit_after>import os
from rhcephpkg import Download
from rhcephpkg.tests.util import fake_urlopen


class TestDownload(object):

    def test_basic_download(self, monkeypatch, tmpdir):
        monkeypatch.setattr('rhcephpkg.download.urlopen', fake_urlopen)
        monkeypatch.chdir(tmpdir)
        download = Download(['rhcephpkg', 'ceph_10.2.0-2redhat1trusty'])
        download.main()
        expected = [
            'ceph_10.2.0-2redhat1trusty.debian.tar.gz',
            'ceph_10.2.0-2redhat1trusty.dsc',
            'ceph_10.2.0-2redhat1trusty_amd64.changes',
            'ceph_10.2.0.orig.tar.gz',
            'libcephfs1-dbg_10.2.0-2redhat1trusty_amd64.deb',
            'librbd-dbg_10.2.0-2redhat1trusty_amd64.deb',
            'ceph_10.2.0-2redhat1trusty_amd64.deb',
            'radosgw_10.2.0-2redhat1trusty_amd64.deb',
            'libcephfs-java_10.2.0-2redhat1trusty_all.deb',
        ]
        for binary in expected:
            assert os.path.isfile(binary)
{'fraction_non_alphanumeric': 0.11791269443050677, 'fraction_numerical': 0.06924234821876568, 'mean_word_length': 2.5480427046263343, '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': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4647283', 'n_tokens_mistral': 830, 'n_tokens_neox': 755, 'n_words': 80}