Exemplo n.º 1
0
    def test_get_gSheet(self):
        gsheet_id = '17qWseEvbuwUmgIpubFL2WIHvyMtYX0I9CpqThmyrlNA' # sheet used for testing
        gid = '192128846'
        reader = gsheets_readonly.get_gSheet(gsheet_id)
        self.assertTrue(str(type(reader)), '_csv.reader')

        reader = gsheets_readonly.get_gSheet(gsheet_id, gid)
        self.assertTrue(str(type(reader)), '_csv.reader')
Exemplo n.º 2
0
    def test_get_headers(self):
        gsheet_id = '17qWseEvbuwUmgIpubFL2WIHvyMtYX0I9CpqThmyrlNA' # sheet used for testing
        gid = '192128846'
        header_sheet1 = ['date','name','employer','description_in_kind','prior_total','amount','in_kind', 'total', 'ytd']
        header_sheet2 = ['date','vendor','street1','city','state','zip','purpose','amount']

        reader = gsheets_readonly.get_gSheet(gsheet_id)
        check_sheet_headers(self, reader, header_sheet1)

        reader = gsheets_readonly.get_gSheet(gsheet_id, gid)
        check_sheet_headers(self, reader, header_sheet2)
Exemplo n.º 3
0
    def test_get_row_data(self):
        gsheet_id = '17qWseEvbuwUmgIpubFL2WIHvyMtYX0I9CpqThmyrlNA' # sheet used for testing
        gid = '192128846'
        data_sheet1 = [
            {'data': ['7/25/17', 'Jane Doe', 'abc 123', '', '', '$250.00', '', '$250.00', '$250.00'], 'empty_row': False},
            {'data': [], 'empty_row': True},
            {'data': ['7/1/17', 'John Doe', 'hogwarts', '', '', '$1,000.00', '', '$1,000.00', '$1,000.00'], 'empty_row': False}
        ]
        data_sheet2 = [
            {'data': ['05/19/2017','123 abc','987 1st street','Minneapolis','MN','55406','testing','$100.00'], 'empty_row': False},
        ]

        reader1 = gsheets_readonly.get_gSheet(gsheet_id)
        check_sheet_data(self, reader1, data_sheet1)

        reader2 = gsheets_readonly.get_gSheet(gsheet_id, gid)
        check_sheet_data(self, reader2, data_sheet2)
Exemplo n.º 4
0
def main(args):
    # sheet_id = '1lohaanU1mZLGUQtQQA1qf6SykFnl8n2j3W8StNzwrsg' # dehn
    # sheet_id = '1V_8Zbja8reS308qgagijrevVaGWdJVC52rTJxORNqLQ' # frey
    # sheet_id = '1WJSDKibltHFlqwU0cb-k7LtzXw0sYESksFUasD0Y30o' # levy pounds
    # sheet_id = '1O26noy7lbO43XuvbV8zPKoI17dl6pb5B9eSMlbTTfLc' # flowers
    # sheet_id = '1yX_1QMHNru2b34W6jOc-MtDzLfPj9pIyUvfIFb7wIm8' # hodges
    sheet_id = '13RF7MDMmKrEzGlpJ9gNL7ORmR-IddJ7U9vccsRYlFHw'  # hoch

    reader = gsheets_readonly.get_gSheet(sheet_id)

    process_contributions(reader)
Exemplo n.º 5
0
def main(args):
    sheet_id = '1lohaanU1mZLGUQtQQA1qf6SykFnl8n2j3W8StNzwrsg'
    candidate_id = 32
    reader = gsheets_readonly.get_gSheet(sheet_id)

    process_contributions(reader, candidate_id)