forked from roopeshvaddepally/python-ebay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_resolution_case_management.py
113 lines (95 loc) · 4.41 KB
/
test_resolution_case_management.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import unittest
from lxml import objectify
from ebay.resolution_case_management import *
caseStatusFilter = ["OPEN","CLOSED"]
caseTypeFilter = ["EBP_INR","RETURN"]
creationDateRangeFilterFrom = "2011-01-01T19:09:02.768Z"
creationDateRangeFilterTo = "2011-04-01T19:09:02.768Z"
itemFilter = {"itemId":"123", "transactionId":"72"}
paginationInput = {"entriesPerPage":"5", "pageNumber":"10"}
sortOrder = "CASE_STATUS_ASCENDING"
caseId = "1"
caseType = "2"
carrierUsed = "US"
trackingNumber = "3"
comments = "MyComment"
messageToBuyer = "Hello Buyer"
escalationReason = {"sellerSNADReason" : "BUYER_STILL_UNHAPPY_AFTER_REFUND"}
appealReason = "Buyer is dumb!"
encoding = "XML"
class TestResolutionCaseManagementApi(unittest.TestCase):
def test_getUserCases(self):
result = getUserCases(caseStatusFilter = caseStatusFilter,
caseTypeFilter = caseTypeFilter,
creationDateRangeFilterFrom = creationDateRangeFilterFrom,
creationDateRangeFilterTo = creationDateRangeFilterTo,
itemFilter = itemFilter,
paginationInput = paginationInput,
sortOrder = sortOrder,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Warning")
def test_getEBPCaseDetail(self):
result = getEBPCaseDetail(caseId=caseId, caseType=caseType, encoding=encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_provideTrackingInfo(self):
result = provideTrackingInfo(caseId = caseId,
caseType = caseType,
carrierUsed = carrierUsed,
trackingNumber = trackingNumber,
comments = comments,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_issueFullRefund(self):
result = issueFullRefund(caseId = caseId,
caseType = caseType,
comments = comments,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_offerOtherSolution(self):
result = offerOtherSolution(caseId = caseId,
caseType = caseType,
messageToBuyer = messageToBuyer,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_escalateToCustomerSuppport(self):
result = escalateToCustomerSuppport(caseId = caseId,
caseType = caseType,
escalationReason = escalationReason,
comments = comments,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Warning")
def test_appealToCustomerSupport(self):
result = appealToCustomerSupport(caseId = caseId,
caseType = caseType,
appealReason = appealReason,
comments = comments,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_getActivityOptions(self):
result = getActivityOptions(caseId = caseId,
caseType = caseType,
encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Failure")
def test_getVersion(self):
result = getVersion(encoding = encoding)
root = objectify.fromstring(result)
ack = root.ack.text
self.assertEqual(ack, "Success")
if __name__ == '__main__':
unittest.main()