-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
228 additions
and
184 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 |
---|---|---|
|
@@ -10,3 +10,5 @@ ynab.conf | |
*.log | ||
*.env | ||
nosetests*.xml | ||
tests/*.json | ||
testscripts/*.json |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,37 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
import unittest | ||
from pynYNAB.ClientFactory import clientfromargs | ||
from pynYNAB.__main__ import parser | ||
from pynYNAB.schema.Entity import toapi_conversion_functions_table, fromapi_conversion_functions_table | ||
from pynYNAB.schema.types import AmountType | ||
|
||
test_budget_name = 'Test Budget - Dont Remove' | ||
|
||
|
||
# this test cases expect that | ||
# a budget named "Test Budget" exists | ||
# in it, there is an account named "Account" | ||
# in it there is a transaction date 27/01/2017 that has inflow == 12.34 € with a memo "TEST TRANSACTION" | ||
# We check the API dict we fetch when syncing budget | ||
class LiveTestBudget(unittest.TestCase): | ||
def __init__(self, *args, **kwargs): | ||
super(LiveTestBudget, self).__init__(*args, **kwargs) | ||
self.transaction = None | ||
self.client = None | ||
|
||
def setUp(self): | ||
args = parser.parse_known_args()[0] | ||
args.budgetname = test_budget_name | ||
self.client = clientfromargs(args, sync=False) | ||
self.client.catalogClient.sync() | ||
self.client.select_budget(test_budget_name) | ||
|
||
def test_api_scaling_is_ok(self): | ||
sync_data = self.client.budgetClient.get_sync_data_obj() | ||
server_entities = sync_data['changed_entities'] | ||
transactions = server_entities['be_transactions'] | ||
amount = None | ||
for transaction in transactions: | ||
if transaction['memo'] == 'TEST TRANSACTION': | ||
amount = fromapi_conversion_functions_table[AmountType](AmountType,transaction['amount']) | ||
self.assertEqual(12.34,amount) |
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
Oops, something went wrong.