diff options
author | Filipp Lepalaan <f@230.to> | 2013-05-20 01:00:57 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-05-20 01:00:57 +0300 |
commit | 1b8089d3307df99e5e12e961ada11072a9c3461e (patch) | |
tree | 8bab7d59935a36bd66383ba8e3397d2bc1cc09a7 /gsxws/returns.py | |
parent | afd1136818b9a99b187c2c7adc5c369172eda22e (diff) | |
download | py-gsxws-1b8089d3307df99e5e12e961ada11072a9c3461e.tar.gz py-gsxws-1b8089d3307df99e5e12e961ada11072a9c3461e.tar.bz2 py-gsxws-1b8089d3307df99e5e12e961ada11072a9c3461e.zip |
Fix for return_label
Diffstat (limited to 'gsxws/returns.py')
-rw-r--r-- | gsxws/returns.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gsxws/returns.py b/gsxws/returns.py index 9043ecd..42c002f 100644 --- a/gsxws/returns.py +++ b/gsxws/returns.py @@ -56,12 +56,12 @@ class Return(GsxObject): The Parts Pending Return API returns a list of all parts that are pending for return, based on the search criteria. - >>> Returns(repairType='CA').get_pending() # doctest: +SKIP + >>> Return(repairType='CA').get_pending() # doctest: +SKIP """ dt = self._make_type('ns1:partsPendingReturnRequestType') dt.repairData = self.data - return self.submit('PartsPendingReturn', dt, 'partsPendingResponse') + return self._submit('PartsPendingReturn', dt, 'partsPendingResponse') def get_report(self): """ @@ -76,12 +76,13 @@ class Return(GsxObject): def get_label(self, part_number): """ The Return Label API retrieves the Return Label for a given Return Order Number. - (Type not found: 'comptiaCode') - so we're parsing the raw SOAP response and creating a "fake" return object from that. + + >>> Return('7458231326').get_label('661-5852') """ if not validate(part_number, 'partNumber'): raise ValueError("%s is not a valid part number" % part_number) + self.partNumber = part_number self._submit("ReturnLabelRequest", "ReturnLabel", "returnLabelData") return self._req.objects[0] @@ -118,7 +119,7 @@ class Return(GsxObject): with the status GPR(2), DOA(1), CTS(3), or TOW(4). The API can be used only by ASP. - >>> Returns().update_parts('G135877430',\ + >>> Return().update_parts('G135877430',\ # doctest: +SKIP [{'partNumber': '661-5174',\ 'comptiaCode': 'Z29',\ 'comptiaModifier': 'A',\ @@ -132,3 +133,12 @@ class Return(GsxObject): dt.repairData = repairData result = self.submit("PartsReturnUpdate", dt) return result + +if __name__ == '__main__': + import sys + import doctest + import logging + from core import connect + logging.basicConfig(level=logging.DEBUG) + connect(*sys.argv[1:]) + doctest.testmod() |