From eb389e5250bc3fcd5e21b1d28ebbb6599eac1ff2 Mon Sep 17 00:00:00 2001 From: Lucas Lofaro Date: Fri, 12 Nov 2021 00:17:22 -0800 Subject: [PATCH] TEST check cross utility edge case --- tests/test_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index b1f686f..bfd2d71 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,7 +2,6 @@ from .config import sample_data from .context import pandas_ta from unittest import skip, TestCase -from unittest.mock import patch import numpy as np import numpy.testing as npt @@ -139,6 +138,9 @@ class TestUtilities(TestCase): self.assertIsInstance(result, Series) npt.assert_array_equal(result, self.crosseddf["crossed"]) + result = self.utils.cross(self.crosseddf["a"], self.crosseddf["b"], above=False) + self.assertFalse(result[0]) + def test_df_dates(self): result = self.utils.df_dates(self.data) self.assertEqual(None, result) @@ -181,7 +183,6 @@ class TestUtilities(TestCase): npt.assert_allclose(self.utils.fibonacci(n=5, zero=True, weighted=True), np.array([0, 1 / 12, 1 / 12, 1 / 6, 1 / 4, 5 / 12])) npt.assert_allclose(self.utils.fibonacci(n=5, zero=False, weighted=True), np.array([1 / 12, 1 / 12, 1 / 6, 1 / 4, 5 / 12])) - def test_geometric_mean(self): returns = pandas_ta.percent_return(self.data.close) result = self.utils.geometric_mean(returns)