diff --git a/bindings/python/tests/CMakeLists.txt b/bindings/python/tests/CMakeLists.txt index 2c45340ae4..28b385e866 100644 --- a/bindings/python/tests/CMakeLists.txt +++ b/bindings/python/tests/CMakeLists.txt @@ -22,6 +22,7 @@ set(test_python_bindings_DATA test_commodity.py test_numeric.py test_split.py - test_transaction.py) + test_transaction.py + test_query.py) set_dist_list(test_python_bindings_DIST CMakeLists.txt ${test_python_bindings_DATA}) diff --git a/bindings/python/tests/runTests.py.in b/bindings/python/tests/runTests.py.in index 38c0d8d1c2..c82fe972fe 100755 --- a/bindings/python/tests/runTests.py.in +++ b/bindings/python/tests/runTests.py.in @@ -12,6 +12,7 @@ from test_transaction import TestTransaction from test_business import TestBusiness from test_commodity import TestCommodity, TestCommodityNamespace from test_numeric import TestGncNumeric +from test_query import TestQuery if __name__ == '__main__': unittest.main() diff --git a/bindings/python/tests/test_query.py b/bindings/python/tests/test_query.py new file mode 100644 index 0000000000..c5478e582a --- /dev/null +++ b/bindings/python/tests/test_query.py @@ -0,0 +1,23 @@ +from unittest import TestCase, main + +from gnucash import Query +from gnucash.gnucash_core_c import GNC_ID_INVOICE + + +class TestQuery(TestCase): + def test_create(self): + query = Query() + self.assertIsInstance(query, Query) + + def test_search_for(self): + query = Query() + + query.search_for(GNC_ID_INVOICE) + self.assertEqual(query.get_search_for(), GNC_ID_INVOICE) + + obj_type = 'gncInvoice' + query.search_for(obj_type) + self.assertEqual(query.get_search_for(), obj_type) + +if __name__ == '__main__': + main()