@@ -48,16 +48,6 @@ def test_pv_decimal(self):
4848 Decimal ('0' )),
4949 Decimal ('-127128.1709461939327295222005' ))
5050
51- def test_npv (self ):
52- assert_almost_equal (
53- npf .npv (0.05 , [- 15000 , 1500 , 2500 , 3500 , 4500 , 6000 ]),
54- 122.89 , 2 )
55-
56- def test_npv_decimal (self ):
57- assert_equal (
58- npf .npv (Decimal ('0.05' ), [- 15000 , 1500 , 2500 , 3500 , 4500 , 6000 ]),
59- Decimal ('122.894854950942692161628715' ))
60-
6151 def test_when (self ):
6252 # begin
6353 assert_equal (npf .rate (10 , 20 , - 3500 , 10000 , 1 ),
@@ -130,6 +120,18 @@ def test_decimal_with_when(self):
130120 Decimal ('0' ), 'end' ))
131121
132122
123+ class TestNpv :
124+ def test_npv (self ):
125+ assert_almost_equal (
126+ npf .npv (0.05 , [- 15000 , 1500 , 2500 , 3500 , 4500 , 6000 ]),
127+ 122.89 , 2 )
128+
129+ def test_npv_decimal (self ):
130+ assert_equal (
131+ npf .npv (Decimal ('0.05' ), [- 15000 , 1500 , 2500 , 3500 , 4500 , 6000 ]),
132+ Decimal ('122.894854950942692161628715' ))
133+
134+
133135class TestPmt :
134136 def test_pmt (self ):
135137 res = npf .pmt (0.08 / 12 , 5 * 12 , 15000 )
0 commit comments