[tests] Add machine-generated test suite

This commit is contained in:
Jan Petykiewicz 2026-02-15 01:41:31 -08:00
commit 1de76bff47
24 changed files with 1703 additions and 0 deletions

28
masque/test/test_oasis.py Normal file
View file

@ -0,0 +1,28 @@
import pytest
import numpy
from numpy.testing import assert_equal
from pathlib import Path
from ..pattern import Pattern
from ..library import Library
from ..file import oasis
def test_oasis_roundtrip(tmp_path):
# Skip if fatamorgana is not installed
pytest.importorskip("fatamorgana")
lib = Library()
pat1 = Pattern()
pat1.polygon((1, 0), vertices=[[0, 0], [10, 0], [10, 10], [0, 10]])
lib["cell1"] = pat1
oas_file = tmp_path / "test.oas"
# OASIS needs units_per_micron
oasis.writefile(lib, oas_file, units_per_micron=1000)
read_lib, info = oasis.readfile(oas_file)
assert "cell1" in read_lib
# Check bounds
assert_equal(read_lib["cell1"].get_bounds(), [[0, 0], [10, 10]])