old_contents: from datetime import datetime
  from unittest import TestCase
  
  from rule import PriceRule
  from stock import Stock
  
  
  class TestPriceRule(TestCase):
      @classmethod
      def setUpClass(cls):
          goog = Stock("GOOG")
          goog.update(datetime(2014, 2, 10), 11)
          cls.exchange = {"GOOG": goog}
  
      def test_a_PriceRule_matches_when_it_meets_the_condition(self):
          """Tests if true is returned when an exchange matches a rule.
  
          """
          rule = PriceRule("GOOG", lambda stock: stock.price > 10)
          self.assertTrue(rule.matches(self.exchange))
  
new_contents: from datetime import datetime
  from unittest import TestCase
  
  from rule import PriceRule
  from stock import Stock
  
  
  class TestPriceRule(TestCase):
      @classmethod
      def setUpClass(cls):
          goog = Stock("GOOG")
          goog.update(datetime(2014, 2, 10), 11)
          cls.exchange = {"GOOG": goog}
  
      def test_a_PriceRule_matches_when_it_meets_the_condition(self):
          """Tests if true is returned when an exchange matches a rule.
  
          """
          rule = PriceRule("GOOG", lambda stock: stock.price > 10)
          self.assertTrue(rule.matches(self.exchange))
  
      def test_a_PriceRule_is_False_if_the_condition_is_not_met(self):
          """Tests if false is returned when an exchange does not match a rule.
  
          """
          rule = PriceRule("GOOG", lambda stock: stock.price < 10)
          self.assertFalse(rule.matches(self.exchange))
  
subject: Add a PriceRule test if a condition is not met.