

def test_ReqPackage_render_as_branch():
    mks1 = find_req('markupsafe', 'jinja2')
    jinja = find_dist('jinja2')
    assert (mks1.project_name == 'markupsafe')
    assert (mks1.installed_version == '0.18')
    assert (mks1.version_spec is None)
    assert (mks1.render_as_branch(jinja, False) == 'markupsafe [installed: 0.18]')
    assert (mks1.render_as_branch(jinja, True) == 'MarkupSafe==0.18')
    mks2 = find_req('markupsafe', 'mako')
    mako = find_dist('mako')
    assert (mks2.project_name == 'MarkupSafe')
    assert (mks2.installed_version == '0.18')
    assert (mks2.version_spec == '>=0.9.2')
    assert (mks2.render_as_branch(mako, False) == 'MarkupSafe [required: >=0.9.2, installed: 0.18]')
    assert (mks2.render_as_branch(mako, True) == 'MarkupSafe==0.18')

dataset/ETHPy150Open naiquevin/pipdeptree/tests/test_pipdeptree.py test_ReqPackage_render_as_branch/original