예제 #1
0
파일: tests.py 프로젝트: rajanski/proprio
 def test_moving_average(self):
     cashflows = [
         Cashflow(
             date=date(2011, 8, 1),
             amount=200,
             description='',
         ),
         Cashflow(
             date=date(2011, 7, 1),
             amount=100,
             description='',
         )
     ]
     self.assertEqual([300, 300],
                      moving_average(to_date=date(2014, 9, 1),
                                     sorted_cashflows=cashflows,
                                     size=2))
     self.assertEqual([0, 0],
                      moving_average(to_date=date(2000, 9, 1),
                                     sorted_cashflows=cashflows,
                                     size=2))
     self.assertEqual([100, 300],
                      moving_average(to_date=date(2011, 9, 1),
                                     sorted_cashflows=cashflows,
                                     size=2))
예제 #2
0
파일: tests.py 프로젝트: oadam/proprio
 def test_moving_average(self):
     cashflows = [
         Cashflow(
             date=date(2011, 8, 1),
             amount=200,
             description='',),
         Cashflow(
             date=date(2011, 7, 1),
             amount=100,
             description='',)]
     self.assertEqual([300, 300], moving_average(
         to_date=date(2014, 9, 1),
         sorted_cashflows=cashflows,
         size=2))
     self.assertEqual([0, 0], moving_average(
         to_date=date(2000, 9, 1),
         sorted_cashflows=cashflows,
         size=2))
     self.assertEqual([100, 300], moving_average(
         to_date=date(2011, 9, 1),
         sorted_cashflows=cashflows,
         size=2))
예제 #3
0
파일: tests.py 프로젝트: oadam/proprio
 def test_moving_average_empty(self):
     self.assertEqual([0, 0], moving_average(
         to_date=date(2013, 1, 1),
         sorted_cashflows=[],
         size=2))
예제 #4
0
파일: tests.py 프로젝트: rajanski/proprio
 def test_moving_average_empty(self):
     self.assertEqual([0, 0],
                      moving_average(to_date=date(2013, 1, 1),
                                     sorted_cashflows=[],
                                     size=2))