Skip to content

Commit

Permalink
Merge pull request ej2#337 from ej2/test-improvements
Browse files Browse the repository at this point in the history
Test Improvements
  • Loading branch information
ej2 authored Jan 4, 2024
2 parents d67795a + 83be8cd commit 73edf4d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
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")

0 comments on commit 73edf4d

Please sign in to comment.