-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T694957: Restructuring tests to have a common Setup and Teardown (#81)
* T694957: Restructuring tests to have a common Setup and Teardown * T694957: Add fixtures for end to end unit testing * T694957: Reorganized test files * T694957: Fixed import order * T694957: is_null is a property now * T694957: Fixed test_spiral_inductor.py Co-authored-by: dmiller <[email protected]>
- Loading branch information
1 parent
16fdbdb
commit 07f4aa0
Showing
14 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
import settings | ||
|
||
from ansys.edb.database import Database | ||
from ansys.edb.layout import Cell, CellType | ||
from ansys.edb.session import session | ||
|
||
|
||
@pytest.fixture | ||
def test_session(): | ||
with session(settings.configs.get("RPC_SERVER_ROOT"), 50051): | ||
yield | ||
|
||
|
||
@pytest.fixture | ||
def new_database_path(tmp_path): | ||
return str(tmp_path / "test.aedb") | ||
|
||
|
||
@pytest.fixture | ||
def new_database(test_session, new_database_path): | ||
db = Database.create(new_database_path) | ||
yield db | ||
db.close() | ||
|
||
|
||
@pytest.fixture | ||
def circuit_cell(new_database): | ||
return Cell.create(new_database, CellType.CIRCUIT_CELL, "circuit_cell") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def test_get_database(circuit_cell, new_database): | ||
cell_db = circuit_cell.database | ||
assert not cell_db.is_null | ||
assert cell_db.id == new_database.id | ||
|
||
|
||
def test_get_layout(circuit_cell): | ||
cell_lyt = circuit_cell.layout | ||
assert not cell_lyt.is_null | ||
assert circuit_cell.id == cell_lyt.cell.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.