From 9c40439a77be3b42966fe69dd85c947e0ad23371 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Thu, 4 Jan 2024 10:19:27 -0600 Subject: [PATCH 1/5] Updated test --- tests/unit/objects/test_exchangerate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/objects/test_exchangerate.py b/tests/unit/objects/test_exchangerate.py index 6e00bd2..15488db 100644 --- a/tests/unit/objects/test_exchangerate.py +++ b/tests/unit/objects/test_exchangerate.py @@ -1,7 +1,7 @@ import unittest from quickbooks import QuickBooks -from quickbooks.objects.exchangerate import ExchangeRate +from quickbooks.objects.exchangerate import ExchangeRate, ExchangeRateMetaData class ExchangeRateTests(unittest.TestCase): @@ -9,7 +9,11 @@ def test_unicode(self): exchange_rate = ExchangeRate() exchange_rate.SourceCurrencyCode = "EUR" + exchange_rate.MetaData = ExchangeRateMetaData() + exchange_rate.MetaData.LastUpdatedTime = "1" + self.assertEqual(str(exchange_rate), "EUR") + self.assertEqual(exchange_rate.MetaData.LastUpdatedTime, "1") def test_valid_object_name(self): obj = ExchangeRate() From c7b9c5284c4bf01cced5b403e738b9da12853860 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Thu, 4 Jan 2024 11:27:24 -0600 Subject: [PATCH 2/5] Update yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e2210b0..f5da930 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,7 +37,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest tests/unit + pytest tests/unit --cov - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From b487322e130657d018dc69b7bd613b9a635d519a Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Thu, 4 Jan 2024 11:29:37 -0600 Subject: [PATCH 3/5] Update yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f5da930..d48c54b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest coverage pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 453d38652a12b5f8bd3d6ac575d33298e07eb6ee Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Thu, 4 Jan 2024 12:52:15 -0600 Subject: [PATCH 4/5] Added tests --- .../integration/test_recurringtransaction.py | 1 + .../unit/objects/test_recurringtransaction.py | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_recurringtransaction.py b/tests/integration/test_recurringtransaction.py index b4c93ea..e3588c8 100644 --- a/tests/integration/test_recurringtransaction.py +++ b/tests/integration/test_recurringtransaction.py @@ -7,6 +7,7 @@ from quickbooks.objects.vendor import Vendor from tests.integration.test_base import QuickbooksTestCase + class RecurringTransactionTest(QuickbooksTestCase): def setUp(self): super(RecurringTransactionTest, self).setUp() diff --git a/tests/unit/objects/test_recurringtransaction.py b/tests/unit/objects/test_recurringtransaction.py index a9b766b..4320818 100644 --- a/tests/unit/objects/test_recurringtransaction.py +++ b/tests/unit/objects/test_recurringtransaction.py @@ -1,7 +1,8 @@ import unittest from quickbooks import QuickBooks -from quickbooks.objects.recurringtransaction import RecurringTransaction +from quickbooks.objects.recurringtransaction import RecurringTransaction, ScheduleInfo, RecurringInfo + class RecurringTransactionTests(unittest.TestCase): def test_valid_object_name(self): @@ -9,4 +10,20 @@ def test_valid_object_name(self): client = QuickBooks() result = client.isvalid_object_name(obj.qbo_object_name) - self.assertTrue(result) \ No newline at end of file + self.assertTrue(result) + + +class ScheduleInfoTest(unittest.TestCase): + def test_create(self): + obj = ScheduleInfo() + obj.DayOfMonth = "1" + + self.assertEqual(obj.DayOfMonth, "1") + + +class RecurringInfoTest(unittest.TestCase): + def test_create(self): + obj = RecurringInfo() + + self.assertEqual(obj.RecurType, "Automated") + From 83be8cdf8c7ee65b2d2e3d7113f29ca28b426d18 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Thu, 4 Jan 2024 12:59:05 -0600 Subject: [PATCH 5/5] Add codecov badge to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbc998e..b0ae95b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ python-quickbooks ================= [![Python package](https://github.com/ej2/python-quickbooks/actions/workflows/python-package.yml/badge.svg)](https://github.com/ej2/python-quickbooks/actions/workflows/python-package.yml) -[![Coverage Status](https://coveralls.io/repos/github/ej2/python-quickbooks/badge.svg?branch=master)](https://coveralls.io/github/ej2/python-quickbooks?branch=master) +[![codecov](https://codecov.io/gh/ej2/python-quickbooks/graph/badge.svg?token=AKXS2F7wvP)](https://codecov.io/gh/ej2/python-quickbooks) [![](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/ej2/python-quickbooks/blob/master/LICENSE) [![PyPI](https://img.shields.io/pypi/v/python-quickbooks)](https://pypi.org/project/python-quickbooks/)