diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e2210b0..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: | @@ -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: 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/) 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_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() 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") +