Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Improvements #337

Merged
merged 5 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_recurringtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/objects/test_exchangerate.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import unittest

from quickbooks import QuickBooks
from quickbooks.objects.exchangerate import ExchangeRate
from quickbooks.objects.exchangerate import ExchangeRate, ExchangeRateMetaData


class ExchangeRateTests(unittest.TestCase):
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()
Expand Down
21 changes: 19 additions & 2 deletions tests/unit/objects/test_recurringtransaction.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
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):
obj = RecurringTransaction()
client = QuickBooks()
result = client.isvalid_object_name(obj.qbo_object_name)

self.assertTrue(result)
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")