Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_render_tree_exclude_reverse():
rtree = reverse_tree(tree)
tree_str = render_tree(rtree, list_all=True, exclude={'itsdangerous', 'SQLAlchemy', 'Flask', 'markupsafe', 'wheel'})
expected = """alembic==0.9.10
click==6.7
Flask-Script==2.0.6
gnureadline==6.3.8
Jinja2==2.10
Lookupy==0.1
Mako==1.0.7
- alembic==0.9.10 [requires: Mako]
psycopg2==2.7.5
python-dateutil==2.7.3
- alembic==0.9.10 [requires: python-dateutil]
python-editor==1.0.3
- alembic==0.9.10 [requires: python-editor>=0.3]
redis==2.10.6
six==1.11.0
def test_reverse_tree():
rtree = reverse_tree(tree)
assert all(isinstance(k, ReqPackage) for k, vs in rtree.items())
assert all(all(isinstance(v, DistPackage) for v in vs)
for k, vs in rtree.items())
assert all(all(v.req is not None for v in vs)
for k, vs in rtree.items())