@@ -113,15 +113,13 @@ def test_ashraeiam_scalar():
113
113
assert_allclose (iam , expected , equal_nan = True )
114
114
115
115
116
- @needs_numpy_1_10
117
- def test_PVSystem_ashraeiam ():
116
+ def test_PVSystem_ashraeiam (mocker ):
118
117
module_parameters = pd .Series ({'b' : 0.05 })
119
118
system = pvsystem .PVSystem (module_parameters = module_parameters )
120
- thetas = np .array ([- 90. , - 67.5 , - 45. , - 22.5 , 0. , 22.5 , 45. , 67.5 , 89. , 90. , np .nan ])
119
+ m = mocker .patch ('pvlib.pvsystem.ashraeiam' )
120
+ thetas = None
121
121
iam = system .ashraeiam (thetas )
122
- expected = np .array ([ 0 , 0.9193437 , 0.97928932 , 0.99588039 , 1. ,
123
- 0.99588039 , 0.97928932 , 0.9193437 , 0 , 0 , np .nan ])
124
- assert_allclose (iam , expected , equal_nan = True )
122
+ m .assert_called_once_with (thetas , ** module_parameters )
125
123
126
124
127
125
@needs_numpy_1_10
@@ -151,15 +149,13 @@ def test_physicaliam_scalar():
151
149
assert_allclose (iam , expected , equal_nan = True )
152
150
153
151
154
- @needs_numpy_1_10
155
- def test_PVSystem_physicaliam ():
152
+ def test_PVSystem_physicaliam_mocked (mocker ):
156
153
module_parameters = pd .Series ({'K' : 4 , 'L' : 0.002 , 'n' : 1.526 })
157
154
system = pvsystem .PVSystem (module_parameters = module_parameters )
158
- thetas = np .array ([- 90. , - 67.5 , - 45. , - 22.5 , 0. , 22.5 , 45. , 67.5 , 90. , np .nan ])
155
+ m = mocker .patch ('pvlib.pvsystem.physicaliam' )
156
+ thetas = None
159
157
iam = system .physicaliam (thetas )
160
- expected = np .array ([ 0 , 0.8893998 , 0.98797788 , 0.99926198 , 1 ,
161
- 0.99926198 , 0.98797788 , 0.8893998 , 0 , np .nan ])
162
- assert_allclose (iam , expected , equal_nan = True )
158
+ m .assert_called_once_with (thetas , ** module_parameters )
163
159
164
160
165
161
# if this completes successfully we'll be able to do more tests below.
0 commit comments