def handleResponse(self, environment, start_response): status = "200 OK" headers = [('Content-Type', 'application/ofx')] start_response(status, headers) if "wsgi.input" in environment: request_body = environment["wsgi.input"].read() if request_body.find("<ACCTTYPE>CHECKING".encode('utf-8')) != -1: return [get_checking_stmt()] elif request_body.find("<ACCTTYPE>SAVINGS".encode('utf-8')) != -1: return [get_savings_stmt()] else: return [get_creditcard_stmt()] else: return [get_creditcard_stmt()]
def setUp(self): self.port = 9486 self.server = MockOfxServer(port=self.port) self.mockurl = "http://localhost:" + str(self.port) + "/" self.institution = Institution(ofx_org="Test Bank", ofx_fid="99999", ofx_url=self.mockurl) self.checking_account = Account(acct_number="1122334455", aba_number="12345678", acct_type="Checking", institution=self.institution) self.savings_account = Account(acct_number="1122334455", aba_number="12345678", acct_type="Savings", institution=self.institution) self.creditcard_account = Account(acct_number="1122334455", aba_number="12345678", acct_type="Credit Card", institution=self.institution) self.username = "******" self.password = "******" self.client = Client() self.checking_stmt = get_checking_stmt().decode('utf-8') self.savings_stmt = get_savings_stmt().decode('utf-8') self.creditcard_stmt = get_creditcard_stmt().decode('utf-8')
def setUp(self): parser = Parser() checking_stmt = get_checking_stmt() creditcard_stmt = get_creditcard_stmt() blank_memo_stmt = get_blank_memo_stmt() self.checkparse = parser.parse(checking_stmt) self.creditcardparse = parser.parse(creditcard_stmt) self.blank_memoparse = parser.parse(blank_memo_stmt)
def setUp(self): self.server = MockOfxServer() self.success = get_creditcard_stmt()