Skip to content

Commit 8b986e9

Browse files
committed
Wrap up testing
1 parent a362f36 commit 8b986e9

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

test/fulfillment_event_test.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@
33
from pyactiveresource.activeresource import ActiveResource
44

55
class FulFillmentEventTest(TestCase):
6-
def setUp(self):
7-
super(FulFillmentEventTest, self).setUp()
8-
self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='GET', body=self.load_fixture('fulfillment_event'))
9-
self.fulfillment_event = shopify.FulfillmentEvent.find(order_id=2776493818019, fulfillment_id=2608403447971)
10-
116
def test_get_fulfillment_event(self):
12-
self.assertEqual(1, len(self.fulfillment_event))
7+
self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='GET', body=self.load_fixture('fulfillment_event'))
8+
fulfillment_event = shopify.FulfillmentEvent.find(order_id=2776493818019, fulfillment_id=2608403447971)
9+
self.assertEqual(1, len(fulfillment_event))
1310

1411
def test_create_fulfillment_event(self):
15-
pass
12+
self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='POST', body=self.load_fixture('fulfillment_event'), headers={'Content-type': 'application/json'})
13+
new_fulfillment_event = shopify.FulfillmentEvent({'order_id': '2776493818019', 'fulfillment_id': '2608403447971'})
14+
new_fulfillment_event.status = 'ready_for_pickup'
15+
new_fulfillment_event.save()
1616

1717
def test_error_on_incorrect_status(self):
1818
with self.assertRaises(AttributeError):
19-
self.fake("orders/2776493818019/fulfillments/2608403447971/events", method='PUT', body=self.load_fixture('article'), headers={'Content-type': 'application/json'})
20-
self.fulfillment_event.save()
19+
self.fake("orders/2776493818019/fulfillments/2608403447971/events/12584341209251", method='GET', body=self.load_fixture('fulfillment_event'))
20+
incorrect_status = 'asdf'
21+
fulfillment_event = shopify.FulfillmentEvent.find(12584341209251, order_id='2776493818019', fulfillment_id='2608403447971')
22+
fulfillment_event.status = incorrect_status
23+
fulfillment_event.save()
24+

0 commit comments

Comments
 (0)