import unittest

from kraken_bot.indicators import rsi, sma


class IndicatorTests(unittest.TestCase):
    def test_sma_returns_none_until_period_is_ready(self) -> None:
        self.assertEqual(sma([1, 2, 3, 4], 3), [None, None, 2.0, 3.0])

    def test_rsi_reaches_100_when_there_are_no_losses(self) -> None:
        values = list(range(1, 20))
        result = rsi(values, 14)
        self.assertEqual(result[-1], 100.0)


if __name__ == "__main__":
    unittest.main()
