@@ -18,24 +18,25 @@ def pkg() -> Package:
1818 return kdb_vlsir (kdbnet , domain = "gplugins.klayout.example" )
1919
2020
21- def test_kdb_vlsir ( pkg ) -> None :
22- """Test the conversion from KLayout DB Netlist to VLSIR Package."""
23- packages = [
24- "taper_L10_W100_W10_LNon_43bc52bd " ,
25- "pad_S100_100_LMTOP_BLNo_163fd346 " ,
21+ @ pytest . mark . parametrize (
22+ "expected_module_name" ,
23+ [
24+ "taper_gdsfactorypcomponentsptapersptaper_L10_W100_W10_L_e6a63921 " ,
25+ "pad_gdsfactorypcomponentsppadsppad_S100_100_LMTOP_BLNon_457de54c " ,
2626 "pads_correct_Ppad_CSmetal3" ,
27- ]
28-
27+ ],
28+ )
29+ def test_kdb_vlsir (pkg : Package , expected_module_name : str ) -> None :
30+ """Test the conversion from KLayout DB Netlist to VLSIR Package."""
2931 assert pkg is not None , "Package should not be None"
30- assert len (pkg .modules ) == 3 , "Expected 3 modules in the package"
31- for i in range (3 ):
32- assert pkg .modules [i ].name == packages [i ], (
33- f"Module[{ i } ] name should be { packages [i ]} "
34- )
32+ module_names = (module .name for module in pkg .modules )
33+ assert expected_module_name in module_names , (
34+ f"Expected module '{ expected_module_name } ' in package modules"
35+ )
3536
3637
3738@pytest .mark .parametrize ("spice_format" , ["spice" , "spectre" , "xyce" , "verilog" ])
38- def test_export_netlist (pkg , spice_format ) -> None :
39+ def test_export_netlist (pkg : Package , spice_format : str ) -> None :
3940 """Test the export of a VLSIR Package to a netlist in the supported formats."""
4041 if spice_format == "verilog" :
4142 with pytest .raises (NotImplementedError ):
0 commit comments