Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/domain/backtests/test_backtest_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def test_save_without_metrics(self):
self.assertTrue(
os.path.exists(os.path.join(backtest_run_dir, "run.json"))
)
self.assertTrue(
# metrics.json is only created when backtest_metrics is provided
self.assertFalse(
os.path.exists(os.path.join(backtest_run_dir, "metrics.json"))
)

Expand Down Expand Up @@ -152,4 +153,3 @@ def test_save_with_precomputed_metrics(self):
self.assertTrue(
os.path.exists(os.path.join(backtest_run_dir, "metrics.json"))
)

5 changes: 3 additions & 2 deletions tests/domain/models/backtesting/test_backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def setUp(self):
)
self.ohlcv_csv_path = os.path.join(
self.resource_dir,
"backtest_data/OHLCV_BTC-EUR_BINANCE_2h_2020-12-15-06-00_2021-01-01-00-30.csv"
"test_data",
"ohlcv",
"OHLCV_BTC-EUR_BINANCE_2h_2023-08-07-07-08_2023-12-02-00-00.csv"
)

# Test models
Expand Down Expand Up @@ -1473,4 +1475,3 @@ def test_backtest_set_uniqueness_by_metadata_id(self):
self.assertEqual(len(backtest_set2), 2)
self.assertIn(backtest4, backtest_set2)
self.assertIn(backtest5, backtest_set2)

4 changes: 2 additions & 2 deletions tests/domain/utils/test_polars.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from investing_algorithm_framework import convert_polars_to_pandas

class TestConvertPandasToPolars(TestCase):

def test_convert_pandas_to_polars(self):
polars_df = DataFrame({
"Datetime": ["2021-01-01", "2021-01-02", "2021-01-03"],
Expand Down Expand Up @@ -33,7 +33,7 @@ def test_convert_pandas_to_polars(self):
self.assertEqual(set(column_names), {'Close'})

# Check if the index is a datetime object
self.assertEqual(polars_df_converted.index.dtype, "datetime64[ns]")
self.assertEqual(polars_df_converted.index.dtype, "datetime64[us]")
self.assertEqual(
polars_df_converted.index[0], Timestamp('2021-01-01 00:00:00')
)
Loading