
P1: JYS
c02 JWBK378-Fletcher May 1, 2009 19:51 Printer: Yet to come
The PPF Package 7
Trying:
print black
scholes(S=42., K=40., r=0.1, sig= 0.2, T=0.5, CP=PUT)
Expecting:
0.808598915338
ok
2 items had no tests:
main
main . test
1 items passed all tests:
2 tests in
main .black scholes
2 tests in 3 items.
2 passed and 0 failed.
Test passed.
2.2.2 PyUnit
A full suite of unit tests for all modules in the ppf package is provided in the ppf.test
sub-package. The tests can be run module-by-module or, to execute all tests in one go, a driver
‘test
all.py’ is provided:
C:\Python25\Lib\site-packages\ppf\test>python test all.py --verbose
python test
all.py --verbose
test
call (test core.black scholes tests) ... ok
test
put (test core.black scholes tests) ... ok
test (test
core.libor rate tests) ... ok
.
.
.
test
upper bound (test utility.bound tests) ... ok
test
equal range (test utility.bound tests) ... ok
test
bound (test utility.bound tests) ... ok
test
bound ci (test utility.bound tests) ... ok
--------------------------------------------------------------------
Ran 51 tests in 25.375s
OK
2.3 BUILDING AND INSTALLING PPF
In this section we look at what it takes to build and install the ppf package.
2.3.1 Prerequisites and Dependencies
ppf is composed of a mixture of pure Python modules underlied by some supporting extension
modules implemented instandard C++. Accordingly, to build and install ppf requiresa modern
C++ compiler. The C++ ...