trim down
This commit is contained in:
parent
457451d3b2
commit
4c2d5051cd
1 changed files with 1789 additions and 1887 deletions
|
|
@ -15,8 +15,8 @@ def port_strategy(draw: Any) -> Port:
|
|||
|
||||
def test_port_snapping() -> None:
|
||||
p = Port(0.123456, 0.654321, 90)
|
||||
assert p.x == 0.123
|
||||
assert p.y == 0.654
|
||||
assert p.x == 0
|
||||
assert p.y == 1
|
||||
|
||||
|
||||
@given(p=port_strategy())
|
||||
|
|
@ -38,14 +38,13 @@ def test_port_transform_invariants(p: Port) -> None:
|
|||
)
|
||||
def test_translate_snapping(p: Port, dx: float, dy: float) -> None:
|
||||
p_trans = translate_port(p, dx, dy)
|
||||
# Check that snapped result is indeed multiple of GRID_SNAP_UM (0.001 um = 1nm)
|
||||
assert abs(p_trans.x * 1000 - round(p_trans.x * 1000)) < 1e-6
|
||||
assert abs(p_trans.y * 1000 - round(p_trans.y * 1000)) < 1e-6
|
||||
assert isinstance(p_trans.x, int)
|
||||
assert isinstance(p_trans.y, int)
|
||||
|
||||
|
||||
def test_orientation_normalization() -> None:
|
||||
p = Port(0, 0, 360)
|
||||
assert p.orientation == 0.0
|
||||
assert p.orientation == 0
|
||||
|
||||
p2 = Port(0, 0, -90)
|
||||
assert p2.orientation == 270.0
|
||||
assert p2.orientation == 270
|
||||
|
|
|
|||
Loading…
Reference in a new issue