Skip to content

Commit

Permalink
create tests/tmp in webapi tests if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerflex committed Jul 6, 2023
1 parent ca23dfe commit bdee52e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/sims/simulation_2_3_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@
"offset": 5.0
},
"name": null,
"interpolate": true,
"polarization": "Hx"
},
{
Expand All @@ -704,8 +705,8 @@
"offset": 5.0
},
"name": null,
"polarization": "Ex",
"interpolate": true
"interpolate": true,
"polarization": "Ex"
},
{
"type": "ModeSource",
Expand Down Expand Up @@ -891,6 +892,7 @@
"offset": 5.0
},
"name": null,
"interpolate": true,
"current_dataset": {
"type": "FieldDataset",
"Ex": "ScalarFieldDataArray",
Expand Down
10 changes: 9 additions & 1 deletion tests/test_web/test_webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
import responses
from _pytest import monkeypatch
import os

import tidy3d as td
import tidy3d.web as web
Expand All @@ -20,15 +21,22 @@

from tidy3d.__main__ import main

from ..utils import TMP_DIR

# variables used below
FNAME_TMP = "tests/tmp/web_test_tmp.json"
FNAME_TMP = os.path.join(TMP_DIR, "web_test_tmp.json")

TASK_NAME = "task_name_test"
TASK_ID = "1234"
CREATED_AT = "2022-01-01T00:00:00.000Z"
PROJECT_NAME = "default"
FLEX_UNIT = 1.0
EST_FLEX_UNIT = 11.11

# make the TMP directory if it doesnt exist
if not os.path.exists(TMP_DIR):
os.mkdir(TMP_DIR)


def make_sim():
"""Makes a simulation."""
Expand Down

0 comments on commit bdee52e

Please sign in to comment.