def test_create_portfolio(self):

        portfolio = f"pf-{str(uuid.uuid4())}"

        up.main(
            parse=lambda: up.parse(args=[
                self.test_scope,
                portfolio,
                "-c",
                portfolio,
                "GBP",
                "2018-01-01",
                "--secrets",
                f"{self.secrets_file}",
            ]),
            display_df=self.display_df,
        )
Exemple #2
0
    def test_upload_multiple_transaction(self):

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

        # Load JLH2 and JLH3 Transactions from second sheet from example Excel file
        up.process_args(
            self.api,
            up.parse(args=[
                "JLH",
                "col:portfolio-code",  # col: prefix indicates code is in the sheet
                "-t",
                f"{self.test_data_path.joinpath('examples').joinpath('transactions-examples.xlsx:Multiple')}",
            ]),
        ).match(
            lambda left: self.fail(lpt.display_error(left)),
            lambda right: self.assertEqual(right, "Done!"),
        )
Exemple #3
0
    def test_upload_transactions(self):

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

        # Load JLH1 Transactions from first sheet from example Excel file
        up.process_args(
            self.api,
            up.parse(args=[
                "JLH",
                "JLH1",
                "-t",
                f"{self.test_data_path.joinpath('examples').joinpath('transactions-examples.xlsx')}",
            ]),
        ).match(
            lambda left: self.fail(lpt.display_error(left)),
            lambda right: self.assertEqual(right, "Done!"),
        )
Exemple #4
0
    def test_upload_holding(self):

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

        up.process_args(
            self.api,
            up.parse(args=[
                "JLH",
                "JLH1",
                "-p",
                f"{self.test_data_path.joinpath('examples').joinpath('holdings-examples.xlsx')}",
                "2019-01-01",
            ]),
        ).match(
            lambda left: self.fail(lpt.display_error(left)),
            lambda right: self.assertEqual(right, "Done!"),
        )