From 37893e8f1d208d5ed9900a74f56af99b56bfc0ff Mon Sep 17 00:00:00 2001 From: Niko Savola Date: Wed, 18 Oct 2023 14:05:14 -0700 Subject: [PATCH] Test `plot_nets` --- gplugins/klayout/tests/test_plot_nets.py | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gplugins/klayout/tests/test_plot_nets.py diff --git a/gplugins/klayout/tests/test_plot_nets.py b/gplugins/klayout/tests/test_plot_nets.py new file mode 100644 index 00000000..65484d5c --- /dev/null +++ b/gplugins/klayout/tests/test_plot_nets.py @@ -0,0 +1,27 @@ +from pathlib import Path + +import pytest +from gdsfactory.samples.demo.lvs import pads_correct + +from gplugins.klayout.get_netlist import get_l2n +from gplugins.klayout.plot_nets import plot_nets + + +@pytest.fixture +def klayout_netlist(tmp_path): + c = pads_correct() + + gdspath = c.write_gds(gdsdir=tmp_path) + l2n = get_l2n(gdspath) + netlist_path = str(Path(tmp_path) / f"{c.name}.txt") + l2n.write_l2n(netlist_path) + return netlist_path + + +def test_plot_nets(klayout_netlist): + plot_nets(klayout_netlist) + + +def test_plot_nets_interactive(klayout_netlist): + plot_nets(klayout_netlist, interactive=True) + assert Path("connectivity.html").exists()