コード例 #1
0
def test_known_ticker_and_unknown_ticker(transactions, capfd):
    """Testing capgains_show when providing a ticker not present in any
    transactions and a ticker that is present in a transaction
    """
    CapGainsShow.capgains_show(transactions, ['GOOGL', 'FB'])
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #2
0
def test_multiple_tickers(transactions, capfd):
    """Testing capgains_show when providing multiple tickers present in any
    transactions
    """
    CapGainsShow.capgains_show(transactions, ['ANET', 'GOOGL'])
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #3
0
def test_unknown_ticker(transactions, capfd):
    """Testing capgains_show when providing a ticker not present in any
    transactions
    """
    CapGainsShow.capgains_show(transactions, tickers=['FB'])
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #4
0
def test_no_filter(transactions, capfd):
    """Testing capgains_show without any filters"""
    CapGainsShow.capgains_show(transactions)
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #5
0
def test_ticker(transactions, capfd):
    """Testing capgains_show when providing a ticker filter"""
    CapGainsShow.capgains_show(transactions, tickers=['ANET'])
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #6
0
def test_no_transactions(capfd):
    """Testing capgains_show without any transactions"""
    CapGainsShow.capgains_show(Transactions([]))
    out, _ = capfd.readouterr()
    assert out == """\
コード例 #7
0
ファイル: cli.py プロジェクト: mohanraj-r/cad-capital-gains
def show(transactions_csv, tickers):
    transactions = TransactionsReader.get_transactions(transactions_csv)
    capgains_show(transactions, tickers)