Exemple #1
0
    def test_aggregate_holdings(self):

        if not self.target_portfolios_exist():
            self.skipTest("missing target portfolios")

        qah.process_args(
            self.api,
            qah.parse(
                args=[
                    "Finbourne-Examples",
                    "Global-Equity",
                    "2020-01-01",
                    "--pricing-scope",
                    "Finbourne-Examples",
                    "--recipe",
                    "FinbourneExamplesRecipeMidThenBid",
                    "--properties",
                    "Instrument/JLH/AssetClass",
                    "Instrument/JLH/Sector",
                    "Instrument/JLH/AssetType",
                ]
            ),
        ).match(
            lambda left: self.fail(lpt.display_error(left)),
            lambda right: self.assertIsInstance(right, DataFrame),
        )
    def test_agg(self):

        result = agg.main(
            parse=lambda: agg.parse(args=[
                self.test_scope,
                self.test_portfolio,
                self.test_date,
                "--secrets",
                f"{self.secrets_file}",
            ]),
            display_df=self.display_df,
        )

        self.validate_results_df(result)