Skip to content

Commit

Permalink
🧪 test: update calendar.json for test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-yang-biz committed Nov 3, 2023
1 parent a47b96e commit 2d65ac9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 56 deletions.
2 changes: 1 addition & 1 deletion omicron/config/calendar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/models/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async def test_save_bars(self):

with freeze_time("2022-12-14 15:00:00"):
rc = await Board.get_last_date_of_bars("881102")
self.assertEqual(rc, datetime.date(2021, 9, 3))
self.assertEqual(rc, datetime.date(2021, 9, 1))

rc = await Board.get_last_date_of_bars("881101")
self.assertEqual(rc, datetime.date(2022, 12, 5))
Expand Down
112 changes: 58 additions & 54 deletions tests/models/test_timeframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,69 +877,73 @@ async def test_save_calendar(self):
self.assertListEqual(day_frames.tolist(), tf.day_frames.tolist())

week_frames = [
20220422,
20220429,
20220506,
20220513,
20220520,
20220527,
20220602,
20220610,
20220617,
20220624,
20220701,
20220708,
20220715,
20220722,
20220729,
20220805,
20220812,
20220819,
20220826,
20220902,
20220909,
20220916,
20220923,
20220930,
20221014,
20221021,
20221028,
20221104,
20221111,
20221118,
20221125,
20221202,
20221209,
20221216,
20221223,
20221230,
20230106,
20230113,
20230120,
20230203,
20230209,
20250103,
20250110,
20250117,
20250124,
20250127,
20250207,
20250214,
20250221,
20250228,
20250307,
20250314,
20250321,
20250328,
20250403,
20250411,
20250418,
20250425,
20250430,
20250509,
20250516,
20250523,
20250530,
20250606,
20250613,
20250620,
20250627,
20250704,
20250711,
20250718,
20250725,
20250801,
20250808,
20250815,
20250822,
20250829,
20250905,
20250912,
20250919,
20250926,
20250930,
20251010,
20251017,
20251024,
20251027,
]

self.assertListEqual(week_frames, tf.week_frames.tolist())

month_frames = [
20220429,
20220531,
20220630,
20220729,
20220831,
20220930,
20221031,
20221130,
20221230,
20230131,
20230209,
20241231,
20250127,
20250228,
20250331,
20250430,
20250530,
20250630,
20250731,
20250829,
20250930,
20251027,
]
self.assertListEqual(month_frames, tf.month_frames.tolist())

quarter_frames = [20220630, 20220930, 20221230, 20230209]
quarter_frames = [20241231, 20250331, 20250630, 20250930, 20251027]
self.assertListEqual(quarter_frames, tf.quarter_frames.tolist())

year_frames = [20221230, 20230209]
year_frames = [20241231, 20251027]
self.assertListEqual(year_frames, tf.year_frames.tolist())

def test_service_degrade(self):
Expand Down

0 comments on commit 2d65ac9

Please sign in to comment.