Skip to content

Commit

Permalink
Adding FulfillmentService endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Cox committed Jan 20, 2014
1 parent a01bb6e commit 3f29f52
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ tags
/dist
/MANIFEST
/ShopifyAPI.egg-info
*.egg
8 changes: 8 additions & 0 deletions CHANGELOG
@@ -1,3 +1,11 @@
== Version 2.0.2

* Add access to FulfillmentService endpoint

== Version 2.0.1

* Package bug fix

== Version 2.0.0

* Removed support for legacy auth
Expand Down
1 change: 1 addition & 0 deletions shopify/resources/__init__.py
Expand Up @@ -34,6 +34,7 @@
from page import Page
from country import Country
from fulfillment import Fulfillment
from fulfillment_service import FulfillmentService
from transaction import Transaction
from image import Image
from variant import Variant
Expand Down
5 changes: 5 additions & 0 deletions shopify/resources/fulfillment_service.py
@@ -0,0 +1,5 @@
from ..base import ShopifyResource

class FulfillmentService(ShopifyResource):
pass

10 changes: 10 additions & 0 deletions test/fixtures/fulfillment_service.json
@@ -0,0 +1,10 @@
{
"fulfillment_service": {
"name": "SomeService",
"id": 123456,
"inventory_management": false,
"tracking_support": true,
"requires_shipping_method": false,
"format": "json"
}
}
15 changes: 15 additions & 0 deletions test/fulfillment_service_test.py
@@ -0,0 +1,15 @@
import shopify
from test_helper import TestCase

class FulfillmentServiceTest(TestCase):
def test_create_new_fulfillment_service(self):
self.fake("fulfillment_services", method='POST', body=self.load_fixture('fulfillment_service'), headers={'Content-type': 'application/json'})

fulfillment_service = shopify.FulfillmentService.create({'name': "SomeService"})
self.assertEqual("SomeService", fulfillment_service.name)

def test_get_fulfillment_service(self):
self.fake("fulfillment_services/123456", method='GET', body=self.load_fixture('fulfillment_service'))

fulfillment_service = shopify.FulfillmentService.find(123456)
self.assertEqual("SomeService", fulfillment_service.name)
2 changes: 1 addition & 1 deletion test/product_test.py
Expand Up @@ -2,7 +2,7 @@
from test_helper import TestCase

class ProductTest(TestCase):

def setUp(self):
super(ProductTest, self).setUp()

Expand Down

0 comments on commit 3f29f52

Please sign in to comment.