diff options
author | Filipp Lepalaan <f@230.to> | 2013-09-02 16:11:41 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-09-02 16:11:41 +0300 |
commit | d3fc9cb6dfc89ea118038a5868b99e459cab911b (patch) | |
tree | 8584b43fc347c13438a07c6498d93e70e83a3c37 | |
parent | 75f0087e4fae39f21d0e362ecc7f8756cc0a828e (diff) | |
download | py-gsxws-d3fc9cb6dfc89ea118038a5868b99e459cab911b.tar.gz py-gsxws-d3fc9cb6dfc89ea118038a5868b99e459cab911b.tar.bz2 py-gsxws-d3fc9cb6dfc89ea118038a5868b99e459cab911b.zip |
Match product line names with those returned by GSX
-rw-r--r-- | gsxws/products.yaml | 4 | ||||
-rw-r--r-- | tests/fixtures/repair_details_ca.xml | 81 | ||||
-rw-r--r-- | tests/test_gsxws.py | 13 |
3 files changed, 96 insertions, 2 deletions
diff --git a/gsxws/products.yaml b/gsxws/products.yaml index 798b092..d6ab4e4 100644 --- a/gsxws/products.yaml +++ b/gsxws/products.yaml @@ -79,12 +79,12 @@ IPHONE: - "iPhone 4S" - "iPhone 5" -IPHONEACC: +IPHONEACCESSORY: name: iPhone Accessory models: - "Bluetooth Headset" -MACACC: +MACACCESSORY: name: Mac Accessory models: - "AirPort Card" diff --git a/tests/fixtures/repair_details_ca.xml b/tests/fixtures/repair_details_ca.xml new file mode 100644 index 0000000..53c3b28 --- /dev/null +++ b/tests/fixtures/repair_details_ca.xml @@ -0,0 +1,81 @@ +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Body> + <ns6:RepairDetailsResponse xmlns:ns2="http://asp.core.endpoint.ws.gsx.ist.apple.com/" xmlns:ns3="http://gsxws.apple.com/elements/global" xmlns:ns4="http://gsxws.apple.com/elements/core/asp" xmlns:ns5="http://gsxws.apple.com/elements/core/asp/am" xmlns:ns6="http://gsxws.apple.com/elements/core"> + <RepairDetailsResponse> + <operationId>2ed251309391636165</operationId> + <lookupResponseData> + <repairConfirmationNumber>2093174681</repairConfirmationNumber> + <soldToCode>0000033523</soldToCode> + <warrantyDescription>Out Of Warranty (No Coverage)</warrantyDescription> + <dispatchId>G2093174681</dispatchId> + <sroNumber>030044147665</sroNumber> + <serialNumber>UV45204MS85</serialNumber> + <dispatchSentDate>2011-01-27 11:45:01 PST</dispatchSentDate> + <coverageStatusDescription>Out Of Warranty (No Coverage)</coverageStatusDescription> + <productName>iBook G4 (14-inch Late 2004)</productName> + <configuration>IBOOK 14.1/1.33G/CTO</configuration> + <purchaseOrderNumber>321213213</purchaseOrderNumber> + <referenceNumber>2123123</referenceNumber> + <isACPlusConsumed>N</isACPlusConsumed> + <notes>Customer Reported Symptom:sa + Service Provider Diagnosis:asda + Notes:ad + -Address Cosmetic Damage? No</notes> + <notaFiscalNumber>123456789</notaFiscalNumber> + <primaryAddress> + <addressLine1>155 ca</addressLine1> + <country>US</country> + <zipCode>95014</zipCode> + <county>Madera</county> + <region>005</region> + <city>CUPERTINO</city> + <firstName>Ääkköset</firstName> + <lastName>Tässäkin</lastName> + <primaryPhone>999999999</primaryPhone> + </primaryAddress> + <partsInfo> + <partNumber>076-1157</partNumber> + <partDescription>Foot Kit, Rubber Feet and Sockets</partDescription> + <partCoverageDescription>Out Of Warranty (No Coverage)</partCoverageDescription> + <orderStatus>Outbound Order Created</orderStatus> + <orderStatusCode>ORDC</orderStatusCode> + <orderStatusDate>2012-04-30 01:26:48 -07:00</orderStatusDate> + <returnStatus>NRET</returnStatus> + <returnCode>NRET</returnCode> + <orderNumber>7148187912</orderNumber> + <orderLineNumber>4</orderLineNumber> + <isSerialized>N</isSerialized> + <notaFiscalNumber>123456789</notaFiscalNumber> + </partsInfo> + <partsInfo> + <partNumber>076-1255</partNumber> + <partDescription>VC,SCREWS,IBOOK MLB, W/NYLOCK</partDescription> + <partCoverageDescription>Out Of Warranty (No Coverage)</partCoverageDescription> + <orderStatus>Outbound Order Created</orderStatus> + <orderStatusCode>ORDC</orderStatusCode> + <orderStatusDate>2012-04-30 05:16:28 -07:00</orderStatusDate> + <returnStatus>NRET</returnStatus> + <returnCode>NRET</returnCode> + <orderNumber>7148187912</orderNumber> + <orderLineNumber>5</orderLineNumber> + <isSerialized>N</isSerialized> + <notaFiscalNumber>123456789</notaFiscalNumber> + </partsInfo> + <partsInfo> + <partNumber>ACSH08</partNumber> + <partDescription>SHIPPING CHARGES FOR CARRY-IN ORDER</partDescription> + <orderStatus>Outbound Order Created</orderStatus> + <orderStatusCode>ORDC</orderStatusCode> + <orderStatusDate>2012-04-30 18:29:58 -07:00</orderStatusDate> + <orderNumber>7148187912</orderNumber> + <orderLineNumber>6</orderLineNumber> + <isSerialized>N</isSerialized> + <notaFiscalNumber>123456789</notaFiscalNumber> + </partsInfo> + <acPlusFlag>N</acPlusFlag> + </lookupResponseData> + <communicationMessage/> + </RepairDetailsResponse> + </ns6:RepairDetailsResponse> + </S:Body> +</S:Envelope> diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index 2596f52..ee1d943 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -10,6 +10,7 @@ from gsxws import repairs, escalations class TestEscalationFunctions(TestCase): + @skip("Skip") def setUp(self): from gsxws.core import connect logging.basicConfig(level=logging.DEBUG) @@ -150,5 +151,17 @@ class TestOnsiteDispatchDetail(TestCase): self.assertIsInstance(self.data.dispatchOrderLines.isSerialized, bool) +class TestCarryinRepairDetail(TestCase): + def setUp(self): + self.data = parse('tests/fixtures/repair_details_ca.xml', + 'lookupResponseData') + + def test_details(self): + self.assertEqual(self.data.dispatchId, 'G2093174681') + + def test_unicode_name(self): + self.assertEqual(self.data.primaryAddress.firstName, u'Ääkköset') + + if __name__ == '__main__': main() |