def test_scan_no_setup_contents(db_session, monkeypatch):
    monkeypatch.setattr(c, 'fetch_url_content', pretend.call_recorder((lambda *a: pretend.stub())))
    monkeypatch.setattr(c, 'extract_file_content', pretend.call_recorder((lambda *a: None)))
    MalwareCheckFactory.create(name='SetupPatternCheck', state=MalwareCheckState.Enabled)
    check = c.SetupPatternCheck(db_session)
    file = FileFactory.create(packagetype='sdist')
    check.scan(obj=file, file_url=pretend.stub())
    assert (len(check._verdicts) == 1)
    assert (check._verdicts[0].check_id == check.id)
    assert (check._verdicts[0].file_id == file.id)
    assert (check._verdicts[0].classification == VerdictClassification.Indeterminate)
    assert (check._verdicts[0].confidence == VerdictConfidence.High)
    assert (check._verdicts[0].message == 'sdist does not contain a suitable setup.py for analysis')
def test_scan_no_setup_contents(db_session, monkeypatch):
    monkeypatch.setattr(c, 'fetch_url_content', pretend.call_recorder((lambda *a: pretend.stub())))
    monkeypatch.setattr(c, 'extract_file_content', pretend.call_recorder((lambda *a: None)))
    MalwareCheckFactory.create(name='SetupPatternCheck', state=MalwareCheckState.Enabled)
    check = c.SetupPatternCheck(db_session)
    file = FileFactory.create(packagetype='sdist')
    check.scan(obj=file, file_url=pretend.stub())
    assert (len(check._verdicts) == 1)
    assert (check._verdicts[0].check_id == check.id)
    assert (check._verdicts[0].file_id == file.id)
    assert (check._verdicts[0].classification == VerdictClassification.Indeterminate)
    assert (check._verdicts[0].confidence == VerdictConfidence.High)
    assert (check._verdicts[0].message == 'sdist does not contain a suitable setup.py for analysis')