def test_mark_new_as_reviewable(): cr1 = creator1() vuln = Vulnerability(state=VulnerabilityState.NEW, creator=cr1) vuln.make_reviewable() assert vuln.state == VulnerabilityState.READY assert vuln.is_reviewable()
def test_mark_needs_improvement_as_reviewable(): cr1 = creator1() vuln = Vulnerability(state=VulnerabilityState.NEEDS_IMPROVEMENT, creator=cr1) vuln.make_reviewable() assert vuln.state == VulnerabilityState.READY assert vuln.is_reviewable()
def test_deny_reviewed(): vuln = Vulnerability(state=VulnerabilityState.REVIEWED) vuln.deny_change('merge conflict') assert vuln.state == VulnerabilityState.NEW assert vuln.review_feedback == 'merge conflict' assert not vuln.is_publishable() assert not vuln.is_reviewable()
def test_return_review(): rev = reviewer() vuln = Vulnerability(state=VulnerabilityState.IN_REVIEW, reviewer=rev) vuln.return_to_review_pool() assert vuln.state == VulnerabilityState.READY assert vuln.reviewer is None assert not vuln.is_publishable() assert vuln.is_reviewable()
def test_deny_reviewed(): vuln = Vulnerability(state=VulnerabilityState.REVIEWED) rev = reviewer() vuln.deny_change(rev, 'merge conflict') assert vuln.state == VulnerabilityState.NEEDS_IMPROVEMENT assert vuln.review_feedback == 'merge conflict' assert not vuln.is_publishable() assert not vuln.is_reviewable()