How to use the pipdeptree.render_json function in pipdeptree

To help you get started, we’ve selected a few pipdeptree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naiquevin / pipdeptree / tests / test_pipdeptree.py View on Github external
def test_render_json(capsys):
    output = render_json(tree, indent=4)
    print_graphviz(output)
    out, _ = capsys.readouterr()
    assert out.startswith('[\n    {\n        "')
    assert out.strip().endswith('}\n]')
    data = json.loads(out)
    assert 'package' in data[0]
    assert 'dependencies' in data[0]