-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some more tests, should improve coverage
- Loading branch information
Showing
3 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import unittest2 | ||
from rbcz import rbcz | ||
from datetime import datetime | ||
|
||
expected_statement_number = 8 | ||
expected_period_start = datetime(2016, 8,1) | ||
expected_period_end = datetime(2016, 8, 31) | ||
expected_account_name = "Test McTestman" | ||
expected_account_number = "2000145399/5500" | ||
expected_iban = "CZ6508000000192000145399" | ||
expected_currency = "CZK" | ||
|
||
class ParseStatementTest(unittest2.TestCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.statement = rbcz.read_statement("./rbcz/test/test_stmt.txt") | ||
super(ParseStatementTest, self).__init__(*args, **kwargs) | ||
|
||
def test_count_movements(self): | ||
self.assertEqual(len(self.statement.movements), 4) | ||
|
||
def test_statement_number(self): | ||
self.assertEqual(self.statement.number, expected_statement_number) | ||
|
||
def test_start_period(self): | ||
self.assertEqual(self.statement.from_date, expected_period_start) | ||
|
||
def test_end_period(self): | ||
self.assertEqual(self.statement.to_date, expected_period_end) | ||
|
||
def test_account_name(self): | ||
self.assertEqual(self.statement.account_name, expected_account_name) | ||
|
||
def test_account_number(self): | ||
self.assertEqual(self.statement.account_number, expected_account_number) | ||
|
||
def test_iban(self): | ||
self.assertEqual(self.statement.iban, expected_iban) | ||
|
||
def test_currency(self): | ||
self.assertEqual(self.statement.currency, expected_currency) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import unittest2 | ||
from rbcz import rbcz | ||
from datetime import datetime | ||
from decimal import Decimal | ||
|
||
expected_statement_number = 8 | ||
expected_period_start = datetime(2016, 8,1) | ||
expected_period_end = datetime(2016, 8, 31) | ||
expected_account_name = "Test McTestman" | ||
expected_account_number = "2000145399/5500" | ||
expected_iban = "CZ6508000000192000145399" | ||
expected_currency = "CZK" | ||
expected_opening_balance = Decimal(100000) | ||
expected_income = Decimal(50000) | ||
expected_expense = Decimal(-30000) | ||
expected_closing_balance = Decimal(120000) | ||
expected_blocked = Decimal(0) | ||
expected_receivable = Decimal(0) | ||
expected_available = Decimal(120000) | ||
|
||
class ParseStatementsTest(unittest2.TestCase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
self.statement = rbcz.read_statements(["./rbcz/test/test_stmt.txt"])[0] | ||
super(ParseStatementsTest, self).__init__(*args, **kwargs) | ||
|
||
def test_count_movements(self): | ||
self.assertEqual(len(self.statement.movements), 4) | ||
|
||
def test_statement_number(self): | ||
self.assertEqual(self.statement.number, expected_statement_number) | ||
|
||
def test_start_period(self): | ||
self.assertEqual(self.statement.from_date, expected_period_start) | ||
|
||
def test_end_period(self): | ||
self.assertEqual(self.statement.to_date, expected_period_end) | ||
|
||
def test_account_name(self): | ||
self.assertEqual(self.statement.account_name, expected_account_name) | ||
|
||
def test_account_number(self): | ||
self.assertEqual(self.statement.account_number, expected_account_number) | ||
|
||
def test_iban(self): | ||
self.assertEqual(self.statement.iban, expected_iban) | ||
|
||
def test_currency(self): | ||
self.assertEqual(self.statement.currency, expected_currency) | ||
|
||
def test_opening_balance(self): | ||
self.assertEqual(expected_opening_balance, self.statement.opening_balance) | ||
|
||
def test_income(self): | ||
self.assertEqual(expected_income, self.statement.income) | ||
|
||
def test_expense(self): | ||
self.assertEqual(expected_expense, self.statement.expenses) | ||
|
||
def test_closing_balance(self): | ||
self.assertEqual(expected_closing_balance, self.statement.closing_balance) | ||
|
||
def test_blocked(self): | ||
self.assertEqual(expected_blocked, self.statement.blocked) | ||
|
||
def test_receivable(self): | ||
self.assertEqual(expected_receivable, self.statement.receivable) | ||
|
||
def test_available(self): | ||
self.assertEqual(expected_available, self.statement.available_balance) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
|
||
Raiffeisenbank a.s. | ||
Bank statement No. 8 | ||
For period 01.08.2016/31.08.2016 | ||
|
||
Name of account: Test McTestman | ||
Account number: 2000145399/5500 | ||
IBAN: CZ6508000000192000145399 | ||
Currency: CZK | ||
|
||
|
||
|
||
|
||
|
||
|
||
====================================================================================== | ||
Year-to-date For statement period | ||
====================================================================================== | ||
Beginning balance 100 000.00 | ||
Income 400 000.00 50 000.00 | ||
Expense -300 000.00 -30 000.00 | ||
Ending balance 120 000.00 | ||
Of which, blocked 0.00 | ||
Receivables past due 0.00 | ||
Available balance 120 000.00 | ||
====================================================================================== | ||
Message for client | ||
The deposit on this account is subject to the protection provided by the system | ||
of insurance of deposit claims. For more details of the system of insurance of deposit | ||
claims, please visit our bank's website: www.rb.cz. | ||
|
||
|
||
Movements on current account | ||
====================================================================================== | ||
No. Date Note Deducted SS Amount Fee | ||
Time Name of account Value VS Exchange | ||
Account number CS Type of transaction Advice | ||
====================================================================================== | ||
1 01.08. 11.08. 50 000.00 | ||
14:47 TestCorp s.r.o | ||
5200011647/5500 558 Enter transfer | ||
-------------------------------------------------------------------------------------- | ||
2 02.08.RB Ceska, Brno, CZE 29.07. -10 000.00 | ||
10:57 Debit Card:516872XXXXX | ||
8323453/5500 1178 Withdraw from ATM | ||
-------------------------------------------------------------------------------------- | ||
3 02.08.RB Ceska, Brno, CZE 31.07. -10 000.00 | ||
10:57 Debit Card:516872XXXXX | ||
8323453/5500 1178 Withdraw from ATM | ||
-------------------------------------------------------------------------------------- | ||
4 02.08. 31.07. -10 000.00 | ||
10:57 Debit Card:516872XXXXX | ||
8323525/5500 1178 Card payment | ||
Billa Namesti Svobody, Brno - Omega, CZE | ||
-------------------------------------------------------------------------------------- |