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_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]