class TestContributorParser(unittest.TestCase):
    def setUp(self):
        self.matcher = ContributorParser()

    def test_can_find_contributors_for_perry(self):
        result = self.matcher.search("Who gave money to Rick Perry")
        data = result.as_json()
        self.assert_("Texans for Perry" in json.loads(data))
        self.assert_("Texans who are really for Perry" in json.loads(data))

    def test_can_find_contributors_for_dewhurst(self):
        result = self.matcher.search("Who gave money to David Dewhurst")
        data = result.as_json()
        self.assert_("Texans for Dewhurst" in json.loads(data))
        self.assert_("Texans who are really for Dewhurst" in json.loads(data))

    def test_returns_none_for_nothing(self):
        result = self.matcher.search("Who did not give money to Rick Perry")
        self.assert_(result is None)
 def setUp(self):
     self.matcher = ContributorParser()