def setUpClass(self): make_test_databases.remove_existing_databases() make_test_databases.make_assignee_db() make_test_databases.make_inventor_db() self.conn = sqlite3.connect("hashTbl.sqlite3") self.cursor = self.conn.cursor() geocode_setup.create_sql_helper_functions(self.conn) geocode_setup.create_hashtbl(self.cursor, self.conn)
def test_fix_state_zip(self): make_test_databases.make_inventor_db() geocode_setup.fix_state_zip(self.c) # Inspect loc table in hashTbl, find something to assert. rows = self.c.execute('select * from loc order by city').fetchall() element = rows[3][1] self.assertTrue('FRISCO' == element,"{0} should be {1}".format(element,'FRISCO')) element = rows[0][5] self.assertTrue('BER' == element,"{0} should be {1}".format(element,'BER')) element = rows[6][1] self.assertTrue('LAGUNA HILLS' == element,"{0} should be {1}".format(element, 'LAGUNA HILLS')) pass