File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 39
39
Py_INCREF ($result);
40
40
}
41
41
42
+ %typemap(out) int swmm_getVersion {
43
+ $result = PyInt_FromLong ($1 );
44
+ }
45
+
42
46
43
47
%apply int *OUTPUT {
44
48
int *index ,
189
193
$function
190
194
}
191
195
196
+ %exception swmm_getVersion
197
+ {
198
+ $function
199
+ }
200
+
192
201
/* INSERTS CUSTOM EXCEPTION HANDLING IN WRAPPER */
193
202
%exception
194
203
{
Original file line number Diff line number Diff line change @@ -114,7 +114,12 @@ def test_version(handle):
114
114
major , minor , patch = solver .swmm_version_info ().split ('.' )
115
115
print (major , minor , patch )
116
116
assert major == '5'
117
-
117
+
118
+ def test_legacy_version (handle ):
119
+ version = solver .swmm_get_version ()
120
+ major = str (version )[0 ]
121
+ assert isinstance (version , int )
122
+ assert major == '5'
118
123
119
124
def test_simulation_unit (handle ):
120
125
simulation_system_unit_option = solver .simulation_get_unit (shared_enum .UnitProperty .SYSTEM_UNIT )
You can’t perform that action at this time.
0 commit comments