def test_worth_at_date(): res = str(st.worth_at_date('transactions', date(2014, 4, 10))) assert "bob 1318.379996" in res assert "alice 1318.379996" in res res = str(st.worth_at_date('transactions', date(2015, 10, 10))) assert "alice 1285.420004" in res assert "bob 1594.939992" in res assert "wilhelm 152.370840" in res res = str(st.worth_at_date('transactions', date(2014, 3, 10))) assert "alice 1001.759994" in res assert "bob 1001.759994" in res
def test_worth_at_date_with_curr(): res = str(st.worth_at_date('transactions', date(2016, 10, 21))) assert "alice 1139.599994" in res assert "bob 1468.800006" in res assert "wilhelm 194.777952" in res assert "scroogeEUR 2.186079" in res assert "scroogeUS 2.000000" in res assert "scroogeCZK 0.080979" in res
from datetime import date import money as mn import read_transaction as rt import stocks as st import report as rp ## This is how the lambda is done # ds['total_czk'] = ds.total_value.apply(lambda x: x * cv.getUSDCZK()) ## Bezny check print "Akcie v USD" print "Dne: " + str(date.today()) print str(st.worth_at_date('../transactions/us_stocks', date.today())) print "V czk:" print str(st.worth_at_date_czk('../transactions/us_stocks', date.today())) print "Investovane penize" print mn.invested(rt.read_file('../transactions/czk')) print "Prodat lze" print str(st.three_years_test('../transactions/us_stocks')) print "Zhodnoceni" print "Honza" print str(rp.appreciation(rt.read_file('../transactions/czk'), '../transactions/us_stocks', 'jd')) print "Deni" print str(rp.appreciation(rt.read_file('../transactions/czk'), '../transactions/us_stocks', 'deni')) print "Mama"