Skip to content

Commit b4cf901

Browse files
committed
Fix siepic models tests
1 parent e8e9539 commit b4cf901

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

tests/libraries/siepic/test_siepic_models.py

+25-26
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,28 @@
55

66
class TestBidirectional_coupler:
77
def test_invalid_parameters(self):
8-
with pytest.raises(ValueError):
8+
with pytest.raises(TypeError):
99
siepic.bidirectional_coupler(pol="tem")
10-
with pytest.raises(ValueError):
10+
with pytest.raises(TypeError):
1111
siepic.bidirectional_coupler(pol="te", thickness=200)
1212

1313
def test_instantiable(self):
1414
siepic.bidirectional_coupler(thickness=220, width=500)
1515

1616
def test_s_params(self, std_wl_um):
17-
bdc = siepic.bidirectional_coupler()
18-
bdc(std_wl_um)
17+
s = siepic.bidirectional_coupler(wl=std_wl_um)
1918

2019

2120
class Testdirectional_coupler:
2221
def test_invalid_parameters(self):
23-
with pytest.raises(ValueError):
22+
with pytest.raises(FileNotFoundError):
2423
siepic.directional_coupler(gap=300)
2524

2625
def test_instantiable(self):
2726
siepic.directional_coupler(gap=200, coupling_length=45)
2827

2928
def test_s_params(self, std_wl_um):
30-
dc = siepic.directional_coupler(gap=200, coupling_length=45)
31-
dc(std_wl_um)
29+
s = siepic.directional_coupler(wl=std_wl_um, gap=200, coupling_length=45)
3230

3331

3432
class Testgrating_coupler:
@@ -42,15 +40,14 @@ def test_instantiable(self):
4240
siepic.grating_coupler(pol="te", thickness=220, dwidth=0)
4341

4442
def test_s_params(self, std_wl_um):
45-
gc = siepic.grating_coupler(pol="te")
46-
gc(std_wl_um)
43+
s = siepic.grating_coupler(wl=std_wl_um, pol="te")
4744

4845

4946
class Testhalf_ring:
5047
def test_invalid_parameters(self):
5148
with pytest.raises(ValueError):
5249
siepic.half_ring(pol="tem")
53-
with pytest.raises(ValueError):
50+
with pytest.raises(FileNotFoundError):
5451
siepic.half_ring(pol="te", gap=30, radius=10)
5552

5653
def test_instantiable(self):
@@ -59,25 +56,29 @@ def test_instantiable(self):
5956
)
6057

6158
def test_s_params(self, std_wl_um):
62-
ring = siepic.half_ring(
63-
pol="te", gap=50, radius=5, width=500, thickness=220, coupling_length=0
59+
s = siepic.half_ring(
60+
wl=std_wl_um,
61+
pol="te",
62+
gap=50,
63+
radius=5,
64+
width=500,
65+
thickness=220,
66+
coupling_length=0,
6467
)
65-
ring(std_wl_um)
6668

6769

6870
class Testtaper:
6971
def test_invalid_parameters(self):
70-
with pytest.raises(ValueError):
72+
with pytest.raises(FileNotFoundError):
7173
siepic.taper(w1=0.3)
72-
with pytest.raises(ValueError):
74+
with pytest.raises(FileNotFoundError):
7375
siepic.taper(w2=0.5)
7476

7577
def test_instantiable(self):
7678
siepic.taper(w1=0.5, w2=1.0, length=10.0)
7779

7880
def test_s_params(self, std_wl_um):
79-
taper = siepic.taper(w1=0.5, w2=1.0, length=10.0)
80-
taper(std_wl_um)
81+
s = siepic.taper(wl=std_wl_um, w1=0.5, w2=1.0, length=10.0)
8182

8283

8384
class Testterminator:
@@ -90,25 +91,24 @@ def test_instantiable(self):
9091
siepic.terminator(pol="tm")
9192

9293
def test_s_params(self, std_wl_um):
93-
term = siepic.terminator(pol="te")
94-
term(std_wl_um)
95-
term = siepic.terminator(pol="tm")
96-
term(std_wl_um)
94+
s = siepic.terminator(wl=std_wl_um, pol="te")
95+
s = siepic.terminator(wl=std_wl_um, pol="tm")
9796

9897

9998
class Testwaveguide:
10099
def test_invalid_parameters(self):
101100
with pytest.raises(ValueError):
102101
siepic.waveguide(pol="tem")
103-
with pytest.raises(ValueError):
102+
with pytest.raises(FileNotFoundError):
104103
siepic.waveguide(height=200)
105104

106105
def test_instantiable(self):
107106
siepic.waveguide(pol="te", length=100, width=500, height=220, loss=2)
108107

109108
def test_s_params(self, std_wl_um):
110-
wg = siepic.waveguide(pol="te", length=100, width=500, height=220, loss=2)
111-
wg(std_wl_um)
109+
s = siepic.waveguide(
110+
wl=std_wl_um, pol="te", length=100, width=500, height=220, loss=2
111+
)
112112

113113

114114
class Testy_branch:
@@ -120,5 +120,4 @@ def test_instantiable(self):
120120
siepic.y_branch(pol="te", thickness=220, width=500)
121121

122122
def test_s_params(self, std_wl_um):
123-
yb = siepic.y_branch(pol="te")
124-
yb(std_wl_um)
123+
s = siepic.y_branch(wl=std_wl_um, pol="te")

0 commit comments

Comments
 (0)