import propublica
import congress

def test_get_members():
    cg = congress.Congress(115)
    cg.get_members(cg.SENATE)

def test_search_members():
    cg = congress.Congress(115)

    # Senate
    print cg.search_members("schumer")
    # Full name
    print cg.search_members("charles schumer")
    # Unknown
    print cg.search_members("foobarbaz")
    # House
    print cg.search_members("lowey")
    # Multiple results
    print cg.search_members("smith")


if __name__ == '__main__':
    propublica.ProPublica.load_api_key()

    test_get_members()
    test_search_members()

@@ -1,12 +1,29 @@
+import unittest%0A%0A
 import propu
@@ -49,36 +49,81 @@
 ss%0A%0A
-def test_get_members():%0A    
+class TestCongress(unittest.TestCase):%0A    def setUp(self):%0A        self.
 cg =
@@ -146,20 +146,72 @@
 ss(115)%0A
+%0A
     
+def test_get_members(self):%0A        members = self.
 cg.get_m
@@ -217,16 +217,21 @@
 members(
+self.
 cg.SENAT
@@ -233,17 +233,100 @@
 SENATE)%0A
-%0A
+        self.assertEqual(len(members), 101) # Luther Strange replaced Sessions%0A%0A    
 def test
@@ -345,122 +345,197 @@
 ers(
+self
 ):%0A    
-cg = congress.Congress(115)%0A%0A    # Senate%0A    print cg.search_members(%22schumer%22)%0A    # Full name%0A    print 
+    # House%0A        self.assertEqual(len(self.cg.search_members(%22lowey%22)), 1)%0A%0A        # Senate%0A        schumer = self.cg.search_members(%22schumer%22)%5B0%5D%0A        schumerFull = self.
 cg.s
@@ -570,146 +570,210 @@
 er%22)
+%5B0%5D
 %0A    
-# Unknown%0A    print cg.search_members(%22foobarbaz%22)%0A
+    self.assertEqual(schumer, schumerFull)%0A%0A   
     
+ 
 # 
-House%0A    print cg.search_members(%22lowey%22)%0A    # Multiple results%0A    print 
+Unknown%0A        self.assertEqual(len(self.cg.search_members(%22foobarbaz%22)), 0)%0A%0A        # Multiple results%0A        self.assertEqual(len(self.
 cg.s
@@ -794,17 +794,21 @@
 %22smith%22)
-%0A
+), 5)
 %0A%0Aif __n
@@ -873,54 +873,24 @@
 y()%0A
-%0A
     
-test_get_members()%0A    test_search_members
+unittest.main
 ()%0A

Add tests