Exemple #1
0
    def test_reset(self):
        # Arrange
        instance = WindowedMinMaxPrices(timedelta(minutes=5))

        # Act
        instance.add_price(
            datetime(2020, 1, 1, 0, 0, 0, tzinfo=pytz.utc),
            Price("1"),
        )
        instance.reset()

        # Assert
        self.assertEqual(None, instance.min_price)
        self.assertEqual(None, instance.max_price)
Exemple #2
0
    def test_reset(self):
        # Arrange
        instance = WindowedMinMaxPrices(timedelta(minutes=5))

        # Act
        instance.add_price(
            datetime(2020, 1, 1, 0, 0, 0, tzinfo=pytz.utc),
            Price.from_str("1"),
        )
        instance.reset()

        # Assert
        assert instance.min_price is None
        assert instance.max_price is None