예제 #1
0
 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')
예제 #2
0
 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')
예제 #3
0
class ClientTests(unittest.TestCase):
    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 test_checking_stmt_request(self):
        response = self.client.get_bank_statement(self.checking_account,
                                                  self.username,
                                                  self.password)
        self.assertEqual(response.as_string(), self.checking_stmt)
    
    def test_savings_stmt_request(self):
        response = self.client.get_bank_statement(self.savings_account,
                                                  self.username,
                                                  self.password)
        self.assertEqual(response.as_string(), self.savings_stmt)
    
    def test_creditcard_stmt_request(self):
        response = self.client.get_creditcard_statement(self.creditcard_account,
                                                        self.username,
                                                        self.password)
        self.assertEqual(response.as_string(), self.creditcard_stmt)
    
    def test_unknown_stmt_request(self):
        checking_response = self.client.get_statement(self.checking_account,
                                                      self.username,
                                                      self.password)
        self.assertEqual(checking_response.as_string(), self.checking_stmt)
        
        savings_response = self.client.get_statement(self.savings_account, 
                                                     self.username,
                                                     self.password)
        self.assertEqual(savings_response.as_string(), self.savings_stmt)
        
        creditcard_response = self.client.get_statement(self.creditcard_account,
                                                        self.username,
                                                        self.password)
        self.assertEqual(creditcard_response.as_string(), self.creditcard_stmt)
예제 #4
0
class ClientTests(unittest.TestCase):
    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 test_checking_stmt_request(self):
        response = self.client.get_bank_statement(self.checking_account,
                                                  self.username, self.password)
        self.assertEqual(response.as_string(), self.checking_stmt)

    def test_savings_stmt_request(self):
        response = self.client.get_bank_statement(self.savings_account,
                                                  self.username, self.password)
        self.assertEqual(response.as_string(), self.savings_stmt)

    def test_creditcard_stmt_request(self):
        response = self.client.get_creditcard_statement(
            self.creditcard_account, self.username, self.password)
        self.assertEqual(response.as_string(), self.creditcard_stmt)

    def test_unknown_stmt_request(self):
        checking_response = self.client.get_statement(self.checking_account,
                                                      self.username,
                                                      self.password)
        self.assertEqual(checking_response.as_string(), self.checking_stmt)

        savings_response = self.client.get_statement(self.savings_account,
                                                     self.username,
                                                     self.password)
        self.assertEqual(savings_response.as_string(), self.savings_stmt)

        creditcard_response = self.client.get_statement(
            self.creditcard_account, self.username, self.password)
        self.assertEqual(creditcard_response.as_string(), self.creditcard_stmt)