Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fce6447 commit ad3596dCopy full SHA for ad3596d
stock_alerter/tests/test_alert.py
@@ -10,7 +10,9 @@
10
class AlertTest(unittest.TestCase):
11
def test_action_is_executed_when_rule_matches(self):
12
exchange = {"GOOG": Stock("GOOG")}
13
- rule = PriceRule("GOOG", lambda stock: stock.price > 10)
+ rule = mock.MagicMock(spec=PriceRule)
14
+ rule.matches.return_value = True
15
+ rule.depends_on.return_value = {"GOOG"}
16
action = mock.MagicMock()
17
alert = Alert("sample alert", rule, action)
18
alert.connect(exchange)
0 commit comments