Skip to content

Commit 8848f84

Browse files
authored
Update PythonRuntimeTests.swift
1 parent 93adecc commit 8848f84

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/PythonKitTests/PythonRuntimeTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,16 @@ class PythonRuntimeTests: XCTestCase {
326326
}
327327
XCTAssertEqual(bytes, otherBytes)
328328
}
329+
330+
func testPythonFunction() {
331+
let pythonAdd = PythonFunction { (params: [PythonObject]) in
332+
let lhs = params[0]
333+
let rhs = params[1]
334+
return lhs + rhs
335+
}.pythonObject
336+
337+
let pythonSum = pythonAdd(2, 3)
338+
XCTAssertNotNil(Double(pythonSum))
339+
XCTAssertEqual(pythonSum, 5)
340+
}
329341
}

0 commit comments

Comments
 (0)