Skip to content

Commit 2b411c5

Browse files
authored
Create test_price_stabilization.py
1 parent 25106c4 commit 2b411c5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/tests/test_price_stabilization.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import unittest
2+
from price_stabilization import PriceStabilization
3+
4+
class TestPriceStabilization(unittest.TestCase):
5+
def setUp(self):
6+
self.ps = PriceStabilization()
7+
8+
def test_predict_price(self):
9+
self.ps.update_price_history(100)
10+
self.ps.update_price_history(105)
11+
predicted = self.ps.predict_price()
12+
self.assertAlmostEqual(predicted, 105, delta=1)
13+
14+
def test_adjust_supply(self):
15+
action = self.ps.adjust_supply(95, 100)
16+
self.assertEqual(action, "Increase supply")
17+
18+
if __name__ == '__main__':
19+
unittest.main()

0 commit comments

Comments
 (0)