Skip to content

Commit

Permalink
Merge pull request #65 from jugaad-py/added-tests-for-index
Browse files Browse the repository at this point in the history
tests added
  • Loading branch information
sevakram committed Dec 23, 2023
2 parents 90c99d8 + 6ddb2fd commit 5484639
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jugaad_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__= "0.25"
__version__= "0.26"
8 changes: 8 additions & 0 deletions tests/test_nse.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ def test_index_csv(self):
rows = [x.split(',') for x in text.split('\n')]
assert rows[1][2] == raw[0]['OPEN']

def test_index_df(self):
from_date = date(2001,1,15)
to_date = date(2001,6,15)
index_df = nse.index_df("NIFTY 50", from_date, to_date)
assert len(index_df) > 100
assert list(index_df.columns) == ['Index Name', 'INDEX_NAME', 'HistoricalDate', 'OPEN', 'HIGH',
'LOW', 'CLOSE']


def test_expiry_dates():
dt = date(2020,1,1)
Expand Down

0 comments on commit 5484639

Please sign in to comment.