mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
At current the Python GncNumeric has issues with type conversion eg.
* GncNumeric(1.3) = 1.00
* GncNumeric("1.3") is OK but any future methods error
This behaviour was relied on for the Account tests to pass as it used
GncNumeric(0.5) == GncNumeric(1.0) but this is not what many users would
expect.
This fix alows GncNumeric to be constructed from a (int, int)
numerator/denominator pair or int/float/str where double_to_gnc_numeric
and string_to_gnc_numeric from C is used.
23 lines
611 B
Python
Executable File
23 lines
611 B
Python
Executable File
#!@-PYTHON-@
|
|
|
|
import unittest
|
|
import os
|
|
|
|
os.environ["GNC_UNINSTALLED"] = "1"
|
|
|
|
from test import test_support
|
|
|
|
from test_book import TestBook
|
|
from test_account import TestAccount
|
|
from test_split import TestSplit
|
|
from test_transaction import TestTransaction
|
|
from test_business import TestBusiness
|
|
from test_commodity import TestCommodity, TestCommodityNamespace
|
|
from test_numeric import TestGncNumeric
|
|
|
|
def test_main():
|
|
test_support.run_unittest(TestBook, TestAccount, TestSplit, TestTransaction, TestBusiness, TestCommodity, TestCommodityNamespace, TestGncNumeric)
|
|
|
|
if __name__ == '__main__':
|
|
test_main()
|