24 lines
780 B
Python
24 lines
780 B
Python
from dataclasses import asdict
|
|
import json
|
|
from pathlib import Path
|
|
|
|
from ..file import gdsii
|
|
from ..file.gdsii.perf import fixture_manifest, write_fixture
|
|
|
|
|
|
def test_gdsii_perf_fixture_smoke(tmp_path: Path) -> None:
|
|
output = tmp_path / 'many_cells.gds'
|
|
manifest = write_fixture(output, preset='many_cells', scale=0.002)
|
|
expected = fixture_manifest(output, preset='many_cells', scale=0.002)
|
|
|
|
assert output.exists()
|
|
assert manifest == expected
|
|
|
|
sidecar = json.loads(output.with_suffix('.gds.json').read_text())
|
|
assert sidecar == asdict(manifest)
|
|
|
|
read_lib, info = gdsii.readfile(output)
|
|
assert info['name'] == manifest.library_name
|
|
assert len(read_lib) == manifest.cells
|
|
assert 'TOP' in read_lib
|
|
assert len(read_lib['TOP'].refs) > 0
|