Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
422 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[run] | ||
source = payer_api | ||
omit = payer_api/tests/* | ||
branch = 1 | ||
|
||
[report] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Changelog | ||
|
||
## 0.1.2 | ||
* Bugfix for URL parsing when query string has blank values | ||
* Minor improvements and stability | ||
* Completed test suite | ||
|
||
## 0.1.1 | ||
* Minor refactoring and improvements | ||
* Added tests | ||
|
||
## 0.1.0 | ||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION = '0.1.1' | ||
VERSION = '0.1.2' | ||
|
||
DEBUG_MODE_BRIEF = "brief" | ||
DEBUG_MODE_SILENT = "silent" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import unittest | ||
|
||
|
||
class TestCase(unittest.TestCase): | ||
# Implement assertIsNotNone for Python runtimes < 2.7 or < 3.1 | ||
if not hasattr(unittest.TestCase, 'assertIsNotNone'): | ||
def assertIsNotNone(self, value, *args): | ||
self.assertNotEqual(value, None, *args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import unittest | ||
from payer_api.tests import TestCase | ||
from payer_api.order import ( | ||
PayerOrder, | ||
PayerBuyerDetails, | ||
PayerOrderItem, | ||
) | ||
|
||
|
||
class TestOrder(TestCase): | ||
|
||
def setUp(self): | ||
self.order = PayerOrder(order_id="123456") | ||
|
||
self.buyer_details = PayerBuyerDetails( | ||
first_name="John", | ||
last_name="Doe", | ||
address_line_1="1234 Main Street", | ||
postal_code="12345", | ||
city="Anywhere", | ||
phone_mobile="012345678", | ||
email="john.doe@host.com", | ||
) | ||
|
||
self.order_items = [ | ||
PayerOrderItem( | ||
description='A product', | ||
price_including_vat=123.50, | ||
vat_percentage=25, | ||
quantity=4, | ||
), | ||
PayerOrderItem( | ||
description='Another product', | ||
price_including_vat=123.0, | ||
vat_percentage=12.5, | ||
quantity=2, | ||
), | ||
] | ||
|
||
self.info_lines = [ | ||
"Shipping with 5 work days", | ||
"Additional line of order info", | ||
] | ||
|
||
def test_add_order_item(self): | ||
for order_item in self.order_items: | ||
self.order.add_order_item(order_item) | ||
self.assertTrue(order_item in self.order.order_items) | ||
|
||
self.assertEqual(self.order.order_items, self.order_items) | ||
|
||
def test_add_info_line(self): | ||
for info_line in self.info_lines: | ||
self.order.add_info_line(info_line) | ||
self.assertTrue(info_line in self.order.info_lines) | ||
|
||
self.assertEqual(self.order.info_lines, self.info_lines) | ||
|
||
def test_set_buyer_details(self): | ||
self.order.set_buyer_details(self.buyer_details) | ||
self.assertEqual(self.order.buyer_details, self.buyer_details) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.