Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
domokane committed Jul 31, 2024
1 parent 23423dd commit 6148f94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions golden_tests/TestFinBond.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,8 @@ def test_bond_payment_dates():

def test_bond_ror():

test_case_file = 'test_cases_bond_ror.csv'
df = pd.read_csv('.//data//' + test_case_file, parse_dates=['buy_date',
'sell_date'])
path = os.path.join(os.path.dirname(__file__), './/data//test_cases_bond_ror.csv')
df = pd.read_csv(path, parse_dates=['buy_date','sell_date'])
# A 10-year bond with 1 coupon per year. code: 210215

bond = Bond(
Expand Down
7 changes: 5 additions & 2 deletions golden_tests/TestFinBondZeroCoupon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane
###############################################################################

import os
import sys

import pandas as pd
sys.path.append("..")

Expand Down Expand Up @@ -50,8 +52,9 @@ def test_bond_zero():


def test_bond_zero_ror():
test_case_file = 'test_cases_bond_zero_ror.csv'
df = pd.read_csv('.//data//' + test_case_file, parse_dates=['buy_date', 'sell_date'])

path = os.path.join(os.path.dirname(__file__), './/data//test_cases_bond_ror.csv')
df = pd.read_csv(path, parse_dates=['buy_date', 'sell_date'])
# A 1-year bond with zero coupon per year. code: 092103011
bond = BondZero(
issue_dt=Date(23, 7, 2021),
Expand Down
8 changes: 4 additions & 4 deletions golden_tests/TestFinBondZeroCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane
###############################################################################

import os
import sys
sys.path.append("..")

import datetime as dt


from FinTestCases import FinTestCases, globalTestCaseMode
from financepy.products.bonds.bond import Bond

from financepy.products.bonds.bond_zero_curve import BondZeroCurve

from financepy.utils.date import Date, from_datetime
from financepy.utils.day_count import DayCountTypes
from financepy.utils.frequency import FrequencyTypes
import datetime as dt
import os

test_cases = FinTestCases(__file__, globalTestCaseMode)

Expand Down

0 comments on commit 6148f94

Please sign in to comment.