def test_get_intermediate_panel_data_from_empty_parsed(self): parsed = [] rates = { "30": "libor_30_dias", "60": "libor_60_dias", "90": "libor_90_dias", "180": "libor_180_dias", "360": "libor_360_dias" } scraper = BCRALiborScraper(False, rates, False) result = scraper.get_intermediate_panel_data_from_parsed(parsed) assert result == []
def test_get_intermediate_panel_date_from_parsed(self): parsed = [{ 'indice_tiempo': date.fromisoformat('2019-04-11'), 'libor_30_dias': Decimal('0.0247263'), 'libor_60_dias': Decimal('0.0253675'), 'libor_90_dias': Decimal('0.0259675'), 'libor_180_dias': Decimal('0.0263125'), 'libor_360_dias': Decimal('0.0273413') }] rates = { "30": "libor_30_dias", "60": "libor_60_dias", "90": "libor_90_dias", "180": "libor_180_dias", "360": "libor_360_dias" } scraper = BCRALiborScraper(False, rates, intermediate_panel_path=None, use_intermediate_panel=False) result = scraper.get_intermediate_panel_data_from_parsed(parsed) assert result == [{ 'indice_tiempo': date.fromisoformat('2019-04-11'), 'type': '360', 'value': Decimal('0.0273413') }, { 'indice_tiempo': date.fromisoformat('2019-04-11'), 'type': '180', 'value': Decimal('0.0263125') }, { 'indice_tiempo': date.fromisoformat('2019-04-11'), 'type': '90', 'value': Decimal('0.0259675') }, { 'indice_tiempo': date.fromisoformat('2019-04-11'), 'type': '60', 'value': Decimal('0.0253675') }, { 'indice_tiempo': date.fromisoformat('2019-04-11'), 'type': '30', 'value': Decimal('0.0247263') }]