pyodide/packages/networkx/test_networkx.py

14 lines
329 B
Python
Raw Normal View History

from pyodide_build.testing import run_in_pyodide
2018-12-06 19:24:31 +00:00
@run_in_pyodide(standalone=True, packages=["networkx"])
def test_networkx_basicgraph():
import networkx as nx
2018-12-06 19:24:31 +00:00
G = nx.Graph()
G.add_nodes_from([1, 2, 3])
G.add_edges_from([(1, 2), (1, 3)])
assert G.number_of_nodes() == 3
assert G.number_of_edges() == 2