def test_get_capital_increase_1101(self):
        analyzer = DividendPolicyAnalyzer('1101')
        cash_dividends = analyzer.get_cash_dividends().get_map()
        self.assertEqual(cash_dividends[datetime.date(1993, 12, 31)], 2.0)
        self.assertEqual(cash_dividends[datetime.date(1994, 12, 31)], 1.0)
        self.assertEqual(cash_dividends[datetime.date(1997, 12, 31)], 0.5)

        stock_dividends = analyzer.get_stock_dividends().get_map()
        self.assertEqual(stock_dividends[datetime.date(1993, 12, 31)], 1.3)
        self.assertEqual(stock_dividends[datetime.date(1994, 12, 31)], 1.2)
        self.assertEqual(stock_dividends[datetime.date(1997, 12, 31)], 1.0)

        employee_stock_bonus_ratio = analyzer.get_employee_stock_bonus_ratio().get_map()
        self.assertEqual(employee_stock_bonus_ratio[datetime.date(1993, 12, 31)], 0.0)
        self.assertEqual(employee_stock_bonus_ratio[datetime.date(1994, 12, 31)], 0.0)
        self.assertEqual(employee_stock_bonus_ratio[datetime.date(1997, 12, 31)], 0.0)
Example #2
0
 def __build_data_param(self, param):
     stock_symbol = param['stock_symbol']
     analyzer = DividendPolicyAnalyzer(stock_symbol)
     cash_dividends = analyzer.get_cash_dividends().get()
     stock_dividends_from_retained_earnings = analyzer.get_stock_dividends_from_retained_earnings(
     ).get()
     stock_dividends_from_capital_reserve = analyzer.get_stock_dividends_from_capital_reserve(
     ).get()
     stock_dividends = analyzer.get_stock_dividends().get()
     employee_stock_bonus_ratio = analyzer.get_employee_stock_bonus_ratio(
     ).get()
     return {
         'cash_dividends': {
             'value': cash_dividends,
             'format': 'float',
         },
         'stock_dividends_from_retained_earnings': {
             'value': stock_dividends_from_retained_earnings,
             'format': 'float',
         },
         'stock_dividends_from_capital_reserve': {
             'value': stock_dividends_from_capital_reserve,
             'format': 'float',
         },
         'stock_dividends': {
             'value': stock_dividends,
             'format': 'float',
         },
         'employee_stock_bonus_ratio': {
             'value': employee_stock_bonus_ratio,
             'format': 'percentage',
         },
     }
 def __build_data_param(self, param):
     stock_symbol = param["stock_symbol"]
     analyzer = DividendPolicyAnalyzer(stock_symbol)
     cash_dividends = analyzer.get_cash_dividends().get()
     stock_dividends_from_retained_earnings = analyzer.get_stock_dividends_from_retained_earnings().get()
     stock_dividends_from_capital_reserve = analyzer.get_stock_dividends_from_capital_reserve().get()
     stock_dividends = analyzer.get_stock_dividends().get()
     employee_stock_bonus_ratio = analyzer.get_employee_stock_bonus_ratio().get()
     return {
         "cash_dividends": {"value": cash_dividends, "format": "float"},
         "stock_dividends_from_retained_earnings": {
             "value": stock_dividends_from_retained_earnings,
             "format": "float",
         },
         "stock_dividends_from_capital_reserve": {"value": stock_dividends_from_capital_reserve, "format": "float"},
         "stock_dividends": {"value": stock_dividends, "format": "float"},
         "employee_stock_bonus_ratio": {"value": employee_stock_bonus_ratio, "format": "percentage"},
     }