Skip to content

Commit c115ee9

Browse files
author
reasto
committed
Changing tickstore tests from _collection.insert_one to add()
1 parent d7b70f0 commit c115ee9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/integration/tickstore/test_toplevel.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,8 @@ def test_should_return_data_when_date_range_spans_libraries(toplevel_tickstore,
7171
arctic.initialize_library('FEED_2011.LEVEL1', tickstore.TICK_STORE_TYPE)
7272
tickstore_2010 = arctic['FEED_2010.LEVEL1']
7373
tickstore_2011 = arctic['FEED_2011.LEVEL1']
74-
toplevel_tickstore._collection.insert_one({'start': dt(2010, 1, 1),
75-
'end': dt(2010, 12, 31, 23, 59, 59),
76-
'library_name': 'FEED_2010.LEVEL1'})
77-
toplevel_tickstore._collection.insert_one({'start': dt(2011, 1, 1),
78-
'end': dt(2011, 12, 31, 23, 59, 59),
79-
'library_name': 'FEED_2011.LEVEL1'})
74+
toplevel_tickstore.add(DateRange(start=dt(2010, 1, 1), end=dt(2010, 12, 31, 23, 59, 59, 999000)), 'FEED_2010.LEVEL1')
75+
toplevel_tickstore.add(DateRange(start=dt(2011, 1, 1), end=dt(2011, 12, 31, 23, 59, 59, 999000)), 'FEED_2011.LEVEL1')
8076
dates = pd.date_range('20100101', periods=6, tz=mktz('Europe/London'))
8177
df_10 = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
8278
tickstore_2010.write('blah', df_10)
@@ -93,12 +89,8 @@ def test_should_return_data_when_date_range_spans_libraries_even_if_one_returns_
9389
arctic.initialize_library('FEED_2011.LEVEL1', tickstore.TICK_STORE_TYPE)
9490
tickstore_2010 = arctic['FEED_2010.LEVEL1']
9591
tickstore_2011 = arctic['FEED_2011.LEVEL1']
96-
toplevel_tickstore._collection.insert_one({'start': dt(2010, 1, 1),
97-
'end': dt(2010, 12, 31, 23, 59, 59),
98-
'library_name': 'FEED_2010.LEVEL1'})
99-
toplevel_tickstore._collection.insert_one({'start': dt(2011, 1, 1),
100-
'end': dt(2011, 12, 31, 23, 59, 59),
101-
'library_name': 'FEED_2011.LEVEL1'})
92+
toplevel_tickstore.add(DateRange(start=dt(2010, 1, 1), end=dt(2010, 12, 31, 23, 59, 59, 999000)), 'FEED_2010.LEVEL1')
93+
toplevel_tickstore.add(DateRange(start=dt(2011, 1, 1), end=dt(2011, 12, 31, 23, 59, 59, 999000)), 'FEED_2011.LEVEL1')
10294
dates = pd.date_range('20100101', periods=6, tz=mktz('Europe/London'))
10395
df_10 = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
10496
tickstore_2010.write('blah', df_10)

0 commit comments

Comments
 (0)