From 1ba5a90316c517619c1a063bf43f732caaff51ff Mon Sep 17 00:00:00 2001 From: Tristan Sokol Date: Tue, 14 Mar 2017 15:17:32 -0500 Subject: [PATCH] move test ->tests and add customer tests --- .gitignore | 1 + .travis.yml | 2 +- test/test_address.py | 48 ---- test/test_capture_transaction_request.py | 48 ---- test/test_capture_transaction_response.py | 48 ---- test/test_card.py | 48 ---- test/test_card_brand.py | 48 ---- test/test_charge_request.py | 48 ---- test/test_charge_response.py | 48 ---- test/test_checkout.py | 48 ---- test/test_country.py | 48 ---- test/test_create_checkout_request.py | 48 ---- test/test_create_checkout_response.py | 48 ---- test/test_create_customer_card_request.py | 48 ---- test/test_create_customer_card_response.py | 48 ---- test/test_create_customer_request.py | 48 ---- test/test_create_customer_response.py | 48 ---- test/test_create_order_request.py | 48 ---- test/test_create_order_request_line_item.py | 48 ---- test/test_create_order_request_order.py | 48 ---- test/test_create_refund_request.py | 48 ---- test/test_create_refund_response.py | 48 ---- test/test_currency.py | 48 ---- test/test_customer.py | 48 ---- test/test_customer_api.py | 62 ------ test/test_customer_group_info.py | 48 ---- test/test_customer_preferences.py | 48 ---- test/test_delete_customer_card_request.py | 48 ---- test/test_delete_customer_card_response.py | 48 ---- test/test_delete_customer_request.py | 48 ---- test/test_delete_customer_response.py | 48 ---- test/test_error.py | 48 ---- test/test_error_category.py | 48 ---- test/test_error_code.py | 48 ---- test/test_list_customers_request.py | 48 ---- test/test_list_customers_response.py | 48 ---- test/test_list_locations_request.py | 48 ---- test/test_list_locations_response.py | 48 ---- test/test_list_refunds_request.py | 48 ---- test/test_list_refunds_response.py | 48 ---- test/test_list_transactions_request.py | 48 ---- test/test_list_transactions_response.py | 48 ---- test/test_location.py | 48 ---- test/test_location_capability.py | 48 ---- test/test_money.py | 48 ---- test/test_order.py | 48 ---- test/test_order_line_item.py | 48 ---- test/test_refund.py | 48 ---- test/test_refund_status.py | 48 ---- test/test_retrieve_customer_request.py | 48 ---- test/test_retrieve_customer_response.py | 48 ---- test/test_retrieve_transaction_request.py | 48 ---- test/test_retrieve_transaction_response.py | 48 ---- test/test_sort_order.py | 48 ---- test/test_tender.py | 48 ---- test/test_tender_card_details.py | 48 ---- test/test_tender_card_details_entry_method.py | 48 ---- test/test_tender_card_details_status.py | 48 ---- test/test_tender_cash_details.py | 48 ---- test/test_tender_type.py | 48 ---- test/test_transaction.py | 48 ---- test/test_transaction_api.py | 62 ------ test/test_transaction_product.py | 48 ---- test/test_update_customer_request.py | 48 ---- test/test_update_customer_response.py | 48 ---- test/test_void_transaction_request.py | 48 ---- test/test_void_transaction_response.py | 48 ---- {test => tests}/__init__.py | 0 {test => tests}/test_checkout_api.py | 0 tests/test_customer_api.py | 100 +++++++++ {test => tests}/test_customer_card_api.py | 0 {test => tests}/test_location_api.py | 0 {test => tests}/test_refund_api.py | 0 tests/test_transaction_api.py | 210 ++++++++++++++++++ {test => tests}/utils/__init__.py | 2 +- {test => tests}/utils/api_test_case.py | 1 - 76 files changed, 313 insertions(+), 3151 deletions(-) delete mode 100644 test/test_address.py delete mode 100644 test/test_capture_transaction_request.py delete mode 100644 test/test_capture_transaction_response.py delete mode 100644 test/test_card.py delete mode 100644 test/test_card_brand.py delete mode 100644 test/test_charge_request.py delete mode 100644 test/test_charge_response.py delete mode 100644 test/test_checkout.py delete mode 100644 test/test_country.py delete mode 100644 test/test_create_checkout_request.py delete mode 100644 test/test_create_checkout_response.py delete mode 100644 test/test_create_customer_card_request.py delete mode 100644 test/test_create_customer_card_response.py delete mode 100644 test/test_create_customer_request.py delete mode 100644 test/test_create_customer_response.py delete mode 100644 test/test_create_order_request.py delete mode 100644 test/test_create_order_request_line_item.py delete mode 100644 test/test_create_order_request_order.py delete mode 100644 test/test_create_refund_request.py delete mode 100644 test/test_create_refund_response.py delete mode 100644 test/test_currency.py delete mode 100644 test/test_customer.py delete mode 100644 test/test_customer_api.py delete mode 100644 test/test_customer_group_info.py delete mode 100644 test/test_customer_preferences.py delete mode 100644 test/test_delete_customer_card_request.py delete mode 100644 test/test_delete_customer_card_response.py delete mode 100644 test/test_delete_customer_request.py delete mode 100644 test/test_delete_customer_response.py delete mode 100644 test/test_error.py delete mode 100644 test/test_error_category.py delete mode 100644 test/test_error_code.py delete mode 100644 test/test_list_customers_request.py delete mode 100644 test/test_list_customers_response.py delete mode 100644 test/test_list_locations_request.py delete mode 100644 test/test_list_locations_response.py delete mode 100644 test/test_list_refunds_request.py delete mode 100644 test/test_list_refunds_response.py delete mode 100644 test/test_list_transactions_request.py delete mode 100644 test/test_list_transactions_response.py delete mode 100644 test/test_location.py delete mode 100644 test/test_location_capability.py delete mode 100644 test/test_money.py delete mode 100644 test/test_order.py delete mode 100644 test/test_order_line_item.py delete mode 100644 test/test_refund.py delete mode 100644 test/test_refund_status.py delete mode 100644 test/test_retrieve_customer_request.py delete mode 100644 test/test_retrieve_customer_response.py delete mode 100644 test/test_retrieve_transaction_request.py delete mode 100644 test/test_retrieve_transaction_response.py delete mode 100644 test/test_sort_order.py delete mode 100644 test/test_tender.py delete mode 100644 test/test_tender_card_details.py delete mode 100644 test/test_tender_card_details_entry_method.py delete mode 100644 test/test_tender_card_details_status.py delete mode 100644 test/test_tender_cash_details.py delete mode 100644 test/test_tender_type.py delete mode 100644 test/test_transaction.py delete mode 100644 test/test_transaction_api.py delete mode 100644 test/test_transaction_product.py delete mode 100644 test/test_update_customer_request.py delete mode 100644 test/test_update_customer_response.py delete mode 100644 test/test_void_transaction_request.py delete mode 100644 test/test_void_transaction_response.py rename {test => tests}/__init__.py (100%) rename {test => tests}/test_checkout_api.py (100%) create mode 100644 tests/test_customer_api.py rename {test => tests}/test_customer_card_api.py (100%) rename {test => tests}/test_location_api.py (100%) rename {test => tests}/test_refund_api.py (100%) create mode 100644 tests/test_transaction_api.py rename {test => tests}/utils/__init__.py (50%) rename {test => tests}/utils/api_test_case.py (95%) diff --git a/.gitignore b/.gitignore index d04a2dd..ec291a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.py[cod] +accounts.json diff --git a/.travis.yml b/.travis.yml index 857d702..f376f27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,6 @@ python: install: - pip install -r requirements.txt - pip install -r test-requirements.txt -script: nosetests ./test +script: nosetests ./tests -v before_install: - openssl aes-256-cbc -K $encrypted_27a1e8612058_key -iv $encrypted_27a1e8612058_iv -in ./travis-ci/accounts.enc -out ./travis-ci/accounts.json -d diff --git a/test/test_address.py b/test/test_address.py deleted file mode 100644 index eeeed22..0000000 --- a/test/test_address.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.address import Address - - -class TestAddress(unittest.TestCase): - """ Address unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAddress(self): - """ - Test Address - """ - model = squareconnect.models.address.Address() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_capture_transaction_request.py b/test/test_capture_transaction_request.py deleted file mode 100644 index c1246af..0000000 --- a/test/test_capture_transaction_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.capture_transaction_request import CaptureTransactionRequest - - -class TestCaptureTransactionRequest(unittest.TestCase): - """ CaptureTransactionRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCaptureTransactionRequest(self): - """ - Test CaptureTransactionRequest - """ - model = squareconnect.models.capture_transaction_request.CaptureTransactionRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_capture_transaction_response.py b/test/test_capture_transaction_response.py deleted file mode 100644 index a940cd8..0000000 --- a/test/test_capture_transaction_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.capture_transaction_response import CaptureTransactionResponse - - -class TestCaptureTransactionResponse(unittest.TestCase): - """ CaptureTransactionResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCaptureTransactionResponse(self): - """ - Test CaptureTransactionResponse - """ - model = squareconnect.models.capture_transaction_response.CaptureTransactionResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_card.py b/test/test_card.py deleted file mode 100644 index 09abed3..0000000 --- a/test/test_card.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.card import Card - - -class TestCard(unittest.TestCase): - """ Card unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCard(self): - """ - Test Card - """ - model = squareconnect.models.card.Card() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_card_brand.py b/test/test_card_brand.py deleted file mode 100644 index d9058b7..0000000 --- a/test/test_card_brand.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.card_brand import CardBrand - - -class TestCardBrand(unittest.TestCase): - """ CardBrand unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCardBrand(self): - """ - Test CardBrand - """ - model = squareconnect.models.card_brand.CardBrand() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_charge_request.py b/test/test_charge_request.py deleted file mode 100644 index 07d8dbd..0000000 --- a/test/test_charge_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.charge_request import ChargeRequest - - -class TestChargeRequest(unittest.TestCase): - """ ChargeRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChargeRequest(self): - """ - Test ChargeRequest - """ - model = squareconnect.models.charge_request.ChargeRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_charge_response.py b/test/test_charge_response.py deleted file mode 100644 index d990fb9..0000000 --- a/test/test_charge_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.charge_response import ChargeResponse - - -class TestChargeResponse(unittest.TestCase): - """ ChargeResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChargeResponse(self): - """ - Test ChargeResponse - """ - model = squareconnect.models.charge_response.ChargeResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_checkout.py b/test/test_checkout.py deleted file mode 100644 index e0ef8cf..0000000 --- a/test/test_checkout.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.checkout import Checkout - - -class TestCheckout(unittest.TestCase): - """ Checkout unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCheckout(self): - """ - Test Checkout - """ - model = squareconnect.models.checkout.Checkout() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_country.py b/test/test_country.py deleted file mode 100644 index 244c880..0000000 --- a/test/test_country.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.country import Country - - -class TestCountry(unittest.TestCase): - """ Country unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCountry(self): - """ - Test Country - """ - model = squareconnect.models.country.Country() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_checkout_request.py b/test/test_create_checkout_request.py deleted file mode 100644 index 5ec9a56..0000000 --- a/test/test_create_checkout_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_checkout_request import CreateCheckoutRequest - - -class TestCreateCheckoutRequest(unittest.TestCase): - """ CreateCheckoutRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCheckoutRequest(self): - """ - Test CreateCheckoutRequest - """ - model = squareconnect.models.create_checkout_request.CreateCheckoutRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_checkout_response.py b/test/test_create_checkout_response.py deleted file mode 100644 index 991f79f..0000000 --- a/test/test_create_checkout_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_checkout_response import CreateCheckoutResponse - - -class TestCreateCheckoutResponse(unittest.TestCase): - """ CreateCheckoutResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCheckoutResponse(self): - """ - Test CreateCheckoutResponse - """ - model = squareconnect.models.create_checkout_response.CreateCheckoutResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_customer_card_request.py b/test/test_create_customer_card_request.py deleted file mode 100644 index 1b616b0..0000000 --- a/test/test_create_customer_card_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_customer_card_request import CreateCustomerCardRequest - - -class TestCreateCustomerCardRequest(unittest.TestCase): - """ CreateCustomerCardRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCustomerCardRequest(self): - """ - Test CreateCustomerCardRequest - """ - model = squareconnect.models.create_customer_card_request.CreateCustomerCardRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_customer_card_response.py b/test/test_create_customer_card_response.py deleted file mode 100644 index bc93810..0000000 --- a/test/test_create_customer_card_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_customer_card_response import CreateCustomerCardResponse - - -class TestCreateCustomerCardResponse(unittest.TestCase): - """ CreateCustomerCardResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCustomerCardResponse(self): - """ - Test CreateCustomerCardResponse - """ - model = squareconnect.models.create_customer_card_response.CreateCustomerCardResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_customer_request.py b/test/test_create_customer_request.py deleted file mode 100644 index 6588287..0000000 --- a/test/test_create_customer_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_customer_request import CreateCustomerRequest - - -class TestCreateCustomerRequest(unittest.TestCase): - """ CreateCustomerRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCustomerRequest(self): - """ - Test CreateCustomerRequest - """ - model = squareconnect.models.create_customer_request.CreateCustomerRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_customer_response.py b/test/test_create_customer_response.py deleted file mode 100644 index 0ac83bf..0000000 --- a/test/test_create_customer_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_customer_response import CreateCustomerResponse - - -class TestCreateCustomerResponse(unittest.TestCase): - """ CreateCustomerResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateCustomerResponse(self): - """ - Test CreateCustomerResponse - """ - model = squareconnect.models.create_customer_response.CreateCustomerResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_order_request.py b/test/test_create_order_request.py deleted file mode 100644 index 8b87a69..0000000 --- a/test/test_create_order_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_order_request import CreateOrderRequest - - -class TestCreateOrderRequest(unittest.TestCase): - """ CreateOrderRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateOrderRequest(self): - """ - Test CreateOrderRequest - """ - model = squareconnect.models.create_order_request.CreateOrderRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_order_request_line_item.py b/test/test_create_order_request_line_item.py deleted file mode 100644 index f4b68fe..0000000 --- a/test/test_create_order_request_line_item.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_order_request_line_item import CreateOrderRequestLineItem - - -class TestCreateOrderRequestLineItem(unittest.TestCase): - """ CreateOrderRequestLineItem unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateOrderRequestLineItem(self): - """ - Test CreateOrderRequestLineItem - """ - model = squareconnect.models.create_order_request_line_item.CreateOrderRequestLineItem() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_order_request_order.py b/test/test_create_order_request_order.py deleted file mode 100644 index 3c02630..0000000 --- a/test/test_create_order_request_order.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_order_request_order import CreateOrderRequestOrder - - -class TestCreateOrderRequestOrder(unittest.TestCase): - """ CreateOrderRequestOrder unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateOrderRequestOrder(self): - """ - Test CreateOrderRequestOrder - """ - model = squareconnect.models.create_order_request_order.CreateOrderRequestOrder() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_refund_request.py b/test/test_create_refund_request.py deleted file mode 100644 index 3fbf1e9..0000000 --- a/test/test_create_refund_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_refund_request import CreateRefundRequest - - -class TestCreateRefundRequest(unittest.TestCase): - """ CreateRefundRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateRefundRequest(self): - """ - Test CreateRefundRequest - """ - model = squareconnect.models.create_refund_request.CreateRefundRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_refund_response.py b/test/test_create_refund_response.py deleted file mode 100644 index 1e4016f..0000000 --- a/test/test_create_refund_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.create_refund_response import CreateRefundResponse - - -class TestCreateRefundResponse(unittest.TestCase): - """ CreateRefundResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateRefundResponse(self): - """ - Test CreateRefundResponse - """ - model = squareconnect.models.create_refund_response.CreateRefundResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_currency.py b/test/test_currency.py deleted file mode 100644 index 9886327..0000000 --- a/test/test_currency.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.currency import Currency - - -class TestCurrency(unittest.TestCase): - """ Currency unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCurrency(self): - """ - Test Currency - """ - model = squareconnect.models.currency.Currency() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_customer.py b/test/test_customer.py deleted file mode 100644 index 65e0e70..0000000 --- a/test/test_customer.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.customer import Customer - - -class TestCustomer(unittest.TestCase): - """ Customer unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCustomer(self): - """ - Test Customer - """ - model = squareconnect.models.customer.Customer() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_customer_api.py b/test/test_customer_api.py deleted file mode 100644 index f4e2e38..0000000 --- a/test/test_customer_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.apis.customer_api import CustomerApi - - -class TestCustomerApi(unittest.TestCase): - """ CustomerApi unit test stubs """ - - def setUp(self): - self.api = squareconnect.apis.customer_api.CustomerApi() - - def tearDown(self): - pass - - def test_create_customer(self): - print ("Start test case for create_customer") - pass - - def test_delete_customer(self): - print ("Start test case for delete_customer") - pass - - def test_list_customers(self): - print ("Start test case for list_customers") - pass - - def test_retrieve_customer(self): - print ("Start test case for retrieve_customer") - pass - - def test_update_customer(self): - print ("Start test case for update_customer") - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_customer_group_info.py b/test/test_customer_group_info.py deleted file mode 100644 index 37981e4..0000000 --- a/test/test_customer_group_info.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.customer_group_info import CustomerGroupInfo - - -class TestCustomerGroupInfo(unittest.TestCase): - """ CustomerGroupInfo unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCustomerGroupInfo(self): - """ - Test CustomerGroupInfo - """ - model = squareconnect.models.customer_group_info.CustomerGroupInfo() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_customer_preferences.py b/test/test_customer_preferences.py deleted file mode 100644 index 42ac151..0000000 --- a/test/test_customer_preferences.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.customer_preferences import CustomerPreferences - - -class TestCustomerPreferences(unittest.TestCase): - """ CustomerPreferences unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCustomerPreferences(self): - """ - Test CustomerPreferences - """ - model = squareconnect.models.customer_preferences.CustomerPreferences() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_delete_customer_card_request.py b/test/test_delete_customer_card_request.py deleted file mode 100644 index 31f9fc4..0000000 --- a/test/test_delete_customer_card_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.delete_customer_card_request import DeleteCustomerCardRequest - - -class TestDeleteCustomerCardRequest(unittest.TestCase): - """ DeleteCustomerCardRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDeleteCustomerCardRequest(self): - """ - Test DeleteCustomerCardRequest - """ - model = squareconnect.models.delete_customer_card_request.DeleteCustomerCardRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_delete_customer_card_response.py b/test/test_delete_customer_card_response.py deleted file mode 100644 index 7f9f8c5..0000000 --- a/test/test_delete_customer_card_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.delete_customer_card_response import DeleteCustomerCardResponse - - -class TestDeleteCustomerCardResponse(unittest.TestCase): - """ DeleteCustomerCardResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDeleteCustomerCardResponse(self): - """ - Test DeleteCustomerCardResponse - """ - model = squareconnect.models.delete_customer_card_response.DeleteCustomerCardResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_delete_customer_request.py b/test/test_delete_customer_request.py deleted file mode 100644 index 2447ece..0000000 --- a/test/test_delete_customer_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.delete_customer_request import DeleteCustomerRequest - - -class TestDeleteCustomerRequest(unittest.TestCase): - """ DeleteCustomerRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDeleteCustomerRequest(self): - """ - Test DeleteCustomerRequest - """ - model = squareconnect.models.delete_customer_request.DeleteCustomerRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_delete_customer_response.py b/test/test_delete_customer_response.py deleted file mode 100644 index 75566ce..0000000 --- a/test/test_delete_customer_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.delete_customer_response import DeleteCustomerResponse - - -class TestDeleteCustomerResponse(unittest.TestCase): - """ DeleteCustomerResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDeleteCustomerResponse(self): - """ - Test DeleteCustomerResponse - """ - model = squareconnect.models.delete_customer_response.DeleteCustomerResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_error.py b/test/test_error.py deleted file mode 100644 index 7c4bd76..0000000 --- a/test/test_error.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.error import Error - - -class TestError(unittest.TestCase): - """ Error unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testError(self): - """ - Test Error - """ - model = squareconnect.models.error.Error() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_error_category.py b/test/test_error_category.py deleted file mode 100644 index 586cb1b..0000000 --- a/test/test_error_category.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.error_category import ErrorCategory - - -class TestErrorCategory(unittest.TestCase): - """ ErrorCategory unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testErrorCategory(self): - """ - Test ErrorCategory - """ - model = squareconnect.models.error_category.ErrorCategory() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_error_code.py b/test/test_error_code.py deleted file mode 100644 index 717f579..0000000 --- a/test/test_error_code.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.error_code import ErrorCode - - -class TestErrorCode(unittest.TestCase): - """ ErrorCode unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testErrorCode(self): - """ - Test ErrorCode - """ - model = squareconnect.models.error_code.ErrorCode() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_customers_request.py b/test/test_list_customers_request.py deleted file mode 100644 index 9c4a315..0000000 --- a/test/test_list_customers_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_customers_request import ListCustomersRequest - - -class TestListCustomersRequest(unittest.TestCase): - """ ListCustomersRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListCustomersRequest(self): - """ - Test ListCustomersRequest - """ - model = squareconnect.models.list_customers_request.ListCustomersRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_customers_response.py b/test/test_list_customers_response.py deleted file mode 100644 index a3fcb02..0000000 --- a/test/test_list_customers_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_customers_response import ListCustomersResponse - - -class TestListCustomersResponse(unittest.TestCase): - """ ListCustomersResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListCustomersResponse(self): - """ - Test ListCustomersResponse - """ - model = squareconnect.models.list_customers_response.ListCustomersResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_locations_request.py b/test/test_list_locations_request.py deleted file mode 100644 index 5f7ef2b..0000000 --- a/test/test_list_locations_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_locations_request import ListLocationsRequest - - -class TestListLocationsRequest(unittest.TestCase): - """ ListLocationsRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListLocationsRequest(self): - """ - Test ListLocationsRequest - """ - model = squareconnect.models.list_locations_request.ListLocationsRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_locations_response.py b/test/test_list_locations_response.py deleted file mode 100644 index ce496a9..0000000 --- a/test/test_list_locations_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_locations_response import ListLocationsResponse - - -class TestListLocationsResponse(unittest.TestCase): - """ ListLocationsResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListLocationsResponse(self): - """ - Test ListLocationsResponse - """ - model = squareconnect.models.list_locations_response.ListLocationsResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_refunds_request.py b/test/test_list_refunds_request.py deleted file mode 100644 index 7d034a5..0000000 --- a/test/test_list_refunds_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_refunds_request import ListRefundsRequest - - -class TestListRefundsRequest(unittest.TestCase): - """ ListRefundsRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListRefundsRequest(self): - """ - Test ListRefundsRequest - """ - model = squareconnect.models.list_refunds_request.ListRefundsRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_refunds_response.py b/test/test_list_refunds_response.py deleted file mode 100644 index ba48432..0000000 --- a/test/test_list_refunds_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_refunds_response import ListRefundsResponse - - -class TestListRefundsResponse(unittest.TestCase): - """ ListRefundsResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListRefundsResponse(self): - """ - Test ListRefundsResponse - """ - model = squareconnect.models.list_refunds_response.ListRefundsResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_transactions_request.py b/test/test_list_transactions_request.py deleted file mode 100644 index 9702363..0000000 --- a/test/test_list_transactions_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_transactions_request import ListTransactionsRequest - - -class TestListTransactionsRequest(unittest.TestCase): - """ ListTransactionsRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListTransactionsRequest(self): - """ - Test ListTransactionsRequest - """ - model = squareconnect.models.list_transactions_request.ListTransactionsRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_list_transactions_response.py b/test/test_list_transactions_response.py deleted file mode 100644 index 47b3398..0000000 --- a/test/test_list_transactions_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.list_transactions_response import ListTransactionsResponse - - -class TestListTransactionsResponse(unittest.TestCase): - """ ListTransactionsResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testListTransactionsResponse(self): - """ - Test ListTransactionsResponse - """ - model = squareconnect.models.list_transactions_response.ListTransactionsResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_location.py b/test/test_location.py deleted file mode 100644 index 5be147e..0000000 --- a/test/test_location.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.location import Location - - -class TestLocation(unittest.TestCase): - """ Location unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLocation(self): - """ - Test Location - """ - model = squareconnect.models.location.Location() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_location_capability.py b/test/test_location_capability.py deleted file mode 100644 index 7f30ff3..0000000 --- a/test/test_location_capability.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.location_capability import LocationCapability - - -class TestLocationCapability(unittest.TestCase): - """ LocationCapability unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLocationCapability(self): - """ - Test LocationCapability - """ - model = squareconnect.models.location_capability.LocationCapability() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_money.py b/test/test_money.py deleted file mode 100644 index 3e80113..0000000 --- a/test/test_money.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.money import Money - - -class TestMoney(unittest.TestCase): - """ Money unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMoney(self): - """ - Test Money - """ - model = squareconnect.models.money.Money() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order.py b/test/test_order.py deleted file mode 100644 index dbc89a0..0000000 --- a/test/test_order.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.order import Order - - -class TestOrder(unittest.TestCase): - """ Order unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """ - Test Order - """ - model = squareconnect.models.order.Order() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_line_item.py b/test/test_order_line_item.py deleted file mode 100644 index 0f2cd01..0000000 --- a/test/test_order_line_item.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.order_line_item import OrderLineItem - - -class TestOrderLineItem(unittest.TestCase): - """ OrderLineItem unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrderLineItem(self): - """ - Test OrderLineItem - """ - model = squareconnect.models.order_line_item.OrderLineItem() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_refund.py b/test/test_refund.py deleted file mode 100644 index 1ca0ea0..0000000 --- a/test/test_refund.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.refund import Refund - - -class TestRefund(unittest.TestCase): - """ Refund unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRefund(self): - """ - Test Refund - """ - model = squareconnect.models.refund.Refund() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_refund_status.py b/test/test_refund_status.py deleted file mode 100644 index fd741e9..0000000 --- a/test/test_refund_status.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.refund_status import RefundStatus - - -class TestRefundStatus(unittest.TestCase): - """ RefundStatus unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRefundStatus(self): - """ - Test RefundStatus - """ - model = squareconnect.models.refund_status.RefundStatus() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_retrieve_customer_request.py b/test/test_retrieve_customer_request.py deleted file mode 100644 index 588a188..0000000 --- a/test/test_retrieve_customer_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.retrieve_customer_request import RetrieveCustomerRequest - - -class TestRetrieveCustomerRequest(unittest.TestCase): - """ RetrieveCustomerRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRetrieveCustomerRequest(self): - """ - Test RetrieveCustomerRequest - """ - model = squareconnect.models.retrieve_customer_request.RetrieveCustomerRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_retrieve_customer_response.py b/test/test_retrieve_customer_response.py deleted file mode 100644 index 62a099b..0000000 --- a/test/test_retrieve_customer_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.retrieve_customer_response import RetrieveCustomerResponse - - -class TestRetrieveCustomerResponse(unittest.TestCase): - """ RetrieveCustomerResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRetrieveCustomerResponse(self): - """ - Test RetrieveCustomerResponse - """ - model = squareconnect.models.retrieve_customer_response.RetrieveCustomerResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_retrieve_transaction_request.py b/test/test_retrieve_transaction_request.py deleted file mode 100644 index a652709..0000000 --- a/test/test_retrieve_transaction_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.retrieve_transaction_request import RetrieveTransactionRequest - - -class TestRetrieveTransactionRequest(unittest.TestCase): - """ RetrieveTransactionRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRetrieveTransactionRequest(self): - """ - Test RetrieveTransactionRequest - """ - model = squareconnect.models.retrieve_transaction_request.RetrieveTransactionRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_retrieve_transaction_response.py b/test/test_retrieve_transaction_response.py deleted file mode 100644 index 9078c21..0000000 --- a/test/test_retrieve_transaction_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.retrieve_transaction_response import RetrieveTransactionResponse - - -class TestRetrieveTransactionResponse(unittest.TestCase): - """ RetrieveTransactionResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testRetrieveTransactionResponse(self): - """ - Test RetrieveTransactionResponse - """ - model = squareconnect.models.retrieve_transaction_response.RetrieveTransactionResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_sort_order.py b/test/test_sort_order.py deleted file mode 100644 index f480c78..0000000 --- a/test/test_sort_order.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.sort_order import SortOrder - - -class TestSortOrder(unittest.TestCase): - """ SortOrder unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSortOrder(self): - """ - Test SortOrder - """ - model = squareconnect.models.sort_order.SortOrder() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender.py b/test/test_tender.py deleted file mode 100644 index 766aa37..0000000 --- a/test/test_tender.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender import Tender - - -class TestTender(unittest.TestCase): - """ Tender unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTender(self): - """ - Test Tender - """ - model = squareconnect.models.tender.Tender() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender_card_details.py b/test/test_tender_card_details.py deleted file mode 100644 index c728b66..0000000 --- a/test/test_tender_card_details.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender_card_details import TenderCardDetails - - -class TestTenderCardDetails(unittest.TestCase): - """ TenderCardDetails unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTenderCardDetails(self): - """ - Test TenderCardDetails - """ - model = squareconnect.models.tender_card_details.TenderCardDetails() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender_card_details_entry_method.py b/test/test_tender_card_details_entry_method.py deleted file mode 100644 index 19da459..0000000 --- a/test/test_tender_card_details_entry_method.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender_card_details_entry_method import TenderCardDetailsEntryMethod - - -class TestTenderCardDetailsEntryMethod(unittest.TestCase): - """ TenderCardDetailsEntryMethod unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTenderCardDetailsEntryMethod(self): - """ - Test TenderCardDetailsEntryMethod - """ - model = squareconnect.models.tender_card_details_entry_method.TenderCardDetailsEntryMethod() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender_card_details_status.py b/test/test_tender_card_details_status.py deleted file mode 100644 index 8b58121..0000000 --- a/test/test_tender_card_details_status.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender_card_details_status import TenderCardDetailsStatus - - -class TestTenderCardDetailsStatus(unittest.TestCase): - """ TenderCardDetailsStatus unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTenderCardDetailsStatus(self): - """ - Test TenderCardDetailsStatus - """ - model = squareconnect.models.tender_card_details_status.TenderCardDetailsStatus() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender_cash_details.py b/test/test_tender_cash_details.py deleted file mode 100644 index 97a4f89..0000000 --- a/test/test_tender_cash_details.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender_cash_details import TenderCashDetails - - -class TestTenderCashDetails(unittest.TestCase): - """ TenderCashDetails unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTenderCashDetails(self): - """ - Test TenderCashDetails - """ - model = squareconnect.models.tender_cash_details.TenderCashDetails() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tender_type.py b/test/test_tender_type.py deleted file mode 100644 index c80e613..0000000 --- a/test/test_tender_type.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.tender_type import TenderType - - -class TestTenderType(unittest.TestCase): - """ TenderType unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTenderType(self): - """ - Test TenderType - """ - model = squareconnect.models.tender_type.TenderType() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transaction.py b/test/test_transaction.py deleted file mode 100644 index f3fe3d5..0000000 --- a/test/test_transaction.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.transaction import Transaction - - -class TestTransaction(unittest.TestCase): - """ Transaction unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTransaction(self): - """ - Test Transaction - """ - model = squareconnect.models.transaction.Transaction() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transaction_api.py b/test/test_transaction_api.py deleted file mode 100644 index c5f3ab3..0000000 --- a/test/test_transaction_api.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.apis.transaction_api import TransactionApi - - -class TestTransactionApi(unittest.TestCase): - """ TransactionApi unit test stubs """ - - def setUp(self): - self.api = squareconnect.apis.transaction_api.TransactionApi() - - def tearDown(self): - pass - - def test_capture_transaction(self): - print ("Start test case for capture_transaction") - pass - - def test_charge(self): - print ("Start test case for charge") - pass - - def test_list_transactions(self): - print ("Start test case for list_transactions") - pass - - def test_retrieve_transaction(self): - print ("Start test case for retrieve_transaction") - pass - - def test_void_transaction(self): - print ("Start test case for void_transaction") - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transaction_product.py b/test/test_transaction_product.py deleted file mode 100644 index 2a732eb..0000000 --- a/test/test_transaction_product.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.transaction_product import TransactionProduct - - -class TestTransactionProduct(unittest.TestCase): - """ TransactionProduct unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTransactionProduct(self): - """ - Test TransactionProduct - """ - model = squareconnect.models.transaction_product.TransactionProduct() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_customer_request.py b/test/test_update_customer_request.py deleted file mode 100644 index aaffa18..0000000 --- a/test/test_update_customer_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.update_customer_request import UpdateCustomerRequest - - -class TestUpdateCustomerRequest(unittest.TestCase): - """ UpdateCustomerRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUpdateCustomerRequest(self): - """ - Test UpdateCustomerRequest - """ - model = squareconnect.models.update_customer_request.UpdateCustomerRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_customer_response.py b/test/test_update_customer_response.py deleted file mode 100644 index 4276489..0000000 --- a/test/test_update_customer_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.update_customer_response import UpdateCustomerResponse - - -class TestUpdateCustomerResponse(unittest.TestCase): - """ UpdateCustomerResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUpdateCustomerResponse(self): - """ - Test UpdateCustomerResponse - """ - model = squareconnect.models.update_customer_response.UpdateCustomerResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_void_transaction_request.py b/test/test_void_transaction_request.py deleted file mode 100644 index 4b8eb0c..0000000 --- a/test/test_void_transaction_request.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.void_transaction_request import VoidTransactionRequest - - -class TestVoidTransactionRequest(unittest.TestCase): - """ VoidTransactionRequest unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testVoidTransactionRequest(self): - """ - Test VoidTransactionRequest - """ - model = squareconnect.models.void_transaction_request.VoidTransactionRequest() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_void_transaction_response.py b/test/test_void_transaction_response.py deleted file mode 100644 index 5fd15cb..0000000 --- a/test/test_void_transaction_response.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -""" -Copyright 2017 Square, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -""" - - -from __future__ import absolute_import - -import os -import sys -import unittest - -import squareconnect -from squareconnect.rest import ApiException -from squareconnect.models.void_transaction_response import VoidTransactionResponse - - -class TestVoidTransactionResponse(unittest.TestCase): - """ VoidTransactionResponse unit test stubs """ - - def setUp(self): - pass - - def tearDown(self): - pass - - def testVoidTransactionResponse(self): - """ - Test VoidTransactionResponse - """ - model = squareconnect.models.void_transaction_response.VoidTransactionResponse() - - -if __name__ == '__main__': - unittest.main() diff --git a/test/__init__.py b/tests/__init__.py similarity index 100% rename from test/__init__.py rename to tests/__init__.py diff --git a/test/test_checkout_api.py b/tests/test_checkout_api.py similarity index 100% rename from test/test_checkout_api.py rename to tests/test_checkout_api.py diff --git a/tests/test_customer_api.py b/tests/test_customer_api.py new file mode 100644 index 0000000..262a8c8 --- /dev/null +++ b/tests/test_customer_api.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +Copyright 2017 Square, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import squareconnect +from squareconnect.rest import ApiException +from squareconnect.models.customer import Customer +from squareconnect.apis.customer_api import CustomerApi + +from .utils import APITestCase + +class TestCustomerApi(APITestCase): + + def setUp(self): + self.api = squareconnect.apis.customer_api.CustomerApi() + + def tearDown(self): + pass + + def test01_create_customer(self): + print ("Start test case for create_customer") + + body = { + 'given_name':"Friendly", + 'family_name':"Sparks", + 'reference_id':"ontour34" + } + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + result = self.api.create_customer(authorization, body) + self.__class__.customer = result.customer + self.assertIsNone(result.errors) + + self.assertIsInstance(result.customer, Customer, "Result instance is not instance of Customer.") + self.assertEqual(result.customer.given_name, "Friendly", "Given name doesn't match.") + self.assertEqual(result.customer.family_name, "Sparks", "Family name doesn't match.") + self.assertEqual(result.customer.reference_id, "ontour34", "reference_id name doesn't match.") + + def test02_retrieve_customer(self): + print ("Start test case for retrieve_customer") + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + customer_id = self.__class__.customer.id + result = self.api.retrieve_customer(authorization, customer_id) + self.assertIsNone(result.errors) + + self.assertIsInstance(result.customer, Customer, "Result instance is not instance of Customer.") + self.assertEqual(result.customer.given_name, "Friendly", "Given name doesn't match.") + self.assertEqual(result.customer.family_name, "Sparks", "Family name doesn't match.") + self.assertEqual(result.customer.reference_id, "ontour34", "reference_id name doesn't match.") + + def test03_list_customers(self): + print ('Start test case for list_customers') + # Problem in retrieve a large list of customers + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + result = self.api.list_customers(authorization=authorization) + self.assertIsNone(result.errors) + + # Second request with previous cursor + if result.cursor is not None: + result = self.customer_api.list_customers(authorization, cursor=result.cursor) + self.assertIsNone(result.errors) + + def test_update_customer(self): + print ("Start test case for update_customer") + pass + + def test04_delete_customer(self): + print ('Start test case for delete_customer') + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + customer_id = self.__class__.customer.id + result = self.api.delete_customer(authorization, customer_id) + self.assertIsNone(result.errors) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_customer_card_api.py b/tests/test_customer_card_api.py similarity index 100% rename from test/test_customer_card_api.py rename to tests/test_customer_card_api.py diff --git a/test/test_location_api.py b/tests/test_location_api.py similarity index 100% rename from test/test_location_api.py rename to tests/test_location_api.py diff --git a/test/test_refund_api.py b/tests/test_refund_api.py similarity index 100% rename from test/test_refund_api.py rename to tests/test_refund_api.py diff --git a/tests/test_transaction_api.py b/tests/test_transaction_api.py new file mode 100644 index 0000000..c7145a0 --- /dev/null +++ b/tests/test_transaction_api.py @@ -0,0 +1,210 @@ +# coding: utf-8 + +""" +Copyright 2017 Square, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest +import uuid +from datetime import timedelta, datetime +from operator import attrgetter +import time + +import squareconnect +from squareconnect.rest import ApiException +from squareconnect.models.transaction import Transaction +from squareconnect.apis.transaction_api import TransactionApi + +from .utils import APITestCase + +class TestTransactionApi(APITestCase): + + def setUp(self): + self.api = squareconnect.apis.transaction_api.TransactionApi() + self.currency = 'USD' + self.transaction_api = TransactionApi() + self.location_id = 'CBASEEffqN8pnVNXwoCL0dSGMVAgAQ' + self.sleepTime = 20 + + def tearDown(self): + pass + + def test01_charge(self): + print ("Start test case for charge") + idempotency_key = str(uuid.uuid1()) + nonce = 'fake-card-nonce-ok' + amount = { + 'amount': 2000, + 'currency': self.currency + } + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + body = { + 'idempotency_key': idempotency_key, + 'card_nonce': nonce + } + self.assertRaises(ApiException, self.transaction_api.charge, authorization, self.location_id, body) + body = { + 'amount_money': amount, + 'card_nonce':nonce + } + self.assertRaises(ApiException, self.transaction_api.charge, authorization, self.location_id, body) + + body = { + 'idempotency_key': idempotency_key, + 'amount_money': amount + } + self.assertRaises(ApiException, self.transaction_api.charge, authorization, self.location_id, body) + + # Expected Success tests + # The idempotence key can only be retried with the same request data. + idempotency_key = str(uuid.uuid1()) + body = { + 'idempotency_key': idempotency_key, + 'card_nonce': nonce, + 'amount_money': amount + } + response = self.transaction_api.charge(authorization, self.location_id, body) + self.assertIsNone(response.errors) + + TestTransactionApi.transaction = response.transaction + # Try a transaction 3 times and assert that only one unique transaction + # was created. + retried_charges = [] + for i in range(0,3): + resp = self.transaction_api.charge(authorization, self.location_id, body) + retried_charges.append(resp) + + transaction_ids = {resp.transaction.id for resp in retried_charges} + self.assertEqual(len(transaction_ids), 1) + self.assertEqual(TestTransactionApi.transaction.tenders[0].id, + retried_charges[0].transaction.tenders[0].id) + # Test the new created transaction can be obtained from ListTransactions endpoint. + # Sleep for 3 seconds because of the delay of processing the transaction + time.sleep(self.sleepTime) + cursor = None + d = datetime.now() - timedelta(0.5) + begin_time = d.isoformat("T") + "Z" + transaction_ids = [] + while True: + list_transactions_response = self.transaction_api.list_transactions(authorization=authorization, + location_id=self.location_id, + cursor=cursor, + begin_time=begin_time) + cursor = list_transactions_response.cursor + ids = map(attrgetter('_id'), list_transactions_response.transactions) + transaction_ids.extend(ids) + if cursor is None: + break + + self.assertIn(TestTransactionApi.transaction.id, transaction_ids) + + def test02_retrieve_transaction(self): + print ('Start test case for retrieve_transaction') + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + response = self.transaction_api.retrieve_transaction(authorization, + self.location_id, TestTransactionApi.transaction.id) + self.assertIsNone(response.errors) + + expected = TestTransactionApi.transaction + retrieved = response.transaction + self.assertEqual(expected.id, retrieved.id) + self.assertEqual(expected.tenders[0].amount_money, retrieved.tenders[0].amount_money) + + def test03_list_transactions(self): + print ('Start test case for list_transactions') + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + location_id = self.location_id + self.assertRaises(ValueError, self.transaction_api.list_transactions, authorization, None) + self.assertRaises(ValueError, self.transaction_api.list_transactions, None, self.location_id) + self.assertRaises(ApiException, self.transaction_api.list_transactions, authorization=authorization, location_id='') + + response = self.transaction_api.list_transactions(authorization, self.location_id) + self.assertIsNone(response.errors) + + transactions = response.transactions + cursor = response.cursor + #print ('cursor: %s' % (cursor)) + if cursor is not None: + list_transactions_response = self.transaction_api.list_transactions(authorization=authorization, + location_id=self.location_id, + cursor=cursor) + if list_transactions_response.transactions is not None: + for t in list_transactions_response.transactions: + self.assertNotIn(t, transactions) + + def test04_capture_transaction(self): + print ('Start test case for capture_trasaction') + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + idempotency_key = str(uuid.uuid1()) + nonce = 'fake-card-nonce-ok' + amount = { + 'amount': 2000, + 'currency': self.currency + } + body = { + 'idempotency_key': idempotency_key, + 'card_nonce': nonce, + 'amount_money': amount, + 'delay_capture': True + } + charge_response = self.transaction_api.charge(authorization, self.location_id, body) + + transaction_id = charge_response.transaction.id + response = self.transaction_api.capture_transaction(authorization, self.location_id, transaction_id) + self.assertIsNone(response.errors) + # The tender card status of the charge above should be + # `Captured` in the RetrieveTransaction response. + time.sleep(self.sleepTime) + retrieved = self.transaction_api.retrieve_transaction(authorization, self.location_id, + transaction_id) + self.assertEqual("CAPTURED", retrieved.transaction.tenders[0].card_details.status) + + def test05_void_transaction(self): + print ('Start test case for void_transaction') + account = self.accounts['US-Prod-Sandbox'] + authorization = account['access_token'] + idempotency_key = str(uuid.uuid1()) + nonce = 'fake-card-nonce-ok' + amount = { + 'amount': 2000, + 'currency': self.currency + } + body = { + 'idempotency_key': idempotency_key, 'card_nonce': nonce, + 'amount_money': amount, 'delay_capture': True + } + charge_response = self.transaction_api.charge(authorization, self.location_id, body) + + transaction_id = charge_response.transaction.id + response = self.transaction_api.void_transaction(authorization, self.location_id, transaction_id) + self.assertIsNone(response.errors) + + time.sleep(self.sleepTime) + retrieved = self.transaction_api.retrieve_transaction(authorization, self.location_id, + transaction_id) + self.assertEqual("VOIDED", retrieved.transaction.tenders[0].card_details.status) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/utils/__init__.py b/tests/utils/__init__.py similarity index 50% rename from test/utils/__init__.py rename to tests/utils/__init__.py index 29b9c1e..eb25ccb 100644 --- a/test/utils/__init__.py +++ b/tests/utils/__init__.py @@ -1,3 +1,3 @@ from __future__ import absolute_import -from .api_test_case import APITestCase +from .api_test_case import APITestCase \ No newline at end of file diff --git a/test/utils/api_test_case.py b/tests/utils/api_test_case.py similarity index 95% rename from test/utils/api_test_case.py rename to tests/utils/api_test_case.py index 24d3014..77f2fd2 100644 --- a/test/utils/api_test_case.py +++ b/tests/utils/api_test_case.py @@ -8,4 +8,3 @@ class APITestCase(unittest.TestCase): def setUpClass(cls): with open('./travis-ci/accounts.json') as json_data: cls.accounts = json.load(json_data) - \ No newline at end of file