| 1 | """The checklist's line for a person run's Person Profile block.""" |
| 2 | |
| 3 | from lib import render, report_checklist |
| 4 | |
| 5 | from tests.test_render_person_profile import _profile, _report |
| 6 | |
| 7 | |
| 8 | def _checklist(rendered): |
| 9 | return report_checklist.build(rendered, environ={}) |
| 10 | |
| 11 | |
| 12 | def test_person_profile_block_adds_the_quiet_and_identity_rule(): |
| 13 | rendered = render.render_compact(_report(_profile())) |
| 14 | block = _checklist(rendered) |
| 15 | assert "`## Person Profile`" in block |
| 16 | assert "`LinkedIn: checked`" in block |
| 17 | assert "quiet" in block |
| 18 | assert "identity is uncertain" in block |
| 19 | |
| 20 | |
| 21 | def test_person_profile_rule_shares_the_digest_line_and_keeps_the_checklist_short(): |
| 22 | with_profile = _checklist(render.render_compact(_report(_profile()))) |
| 23 | without = _checklist(render.render_compact(_report())) |
| 24 | count = lambda text: len([line for line in text.splitlines() if line.strip()]) |
| 25 | assert count(with_profile) == count(without) |
| 26 | assert "Person Profile" not in without |
| 27 |