예제 #1
0
 def test_dump(self):
     rep = repairs.Repair(blaa='ääöö')
     part = repairs.RepairOrderLine()
     part.partNumber = '661-5571'
     rep.orderLines = [part]
     self.assertRegex(str(rep.dumps()),
                      r'<GsxObject><blaa>ääöö</blaa><orderLines>')
예제 #2
0
    def setUp(self):
        from gsxws.core import connect
        connect(os.getenv('GSX_USER'), os.getenv('GSX_SOLDTO'), os.getenv('GSX_ENV'))
        self.sn = os.getenv('GSX_SN')
        device = Product(sn=self.sn)
        comptia_codes = comptia.fetch()

        # pick the first part with a component code
        self.first_part = [x for x in device.parts() if not empty(x.componentCode)][0]

        self.part = repairs.RepairOrderLine()
        self.part.partNumber = os.getenv('GSX_PART', self.first_part.partNumber)
        comptia_code = comptia_codes[self.first_part.componentCode]
        self.part.comptiaCode = comptia_code[0][0]
        self.part.comptiaModifier = 'A'
예제 #3
0
    def setUp(self):
        super(RemoteDeviceTestCase, self).setUp()
        device = Product(sn=self.sn)
        comptia_codes = comptia.fetch()

        # pick the first part with a component code
        self.first_part = [
            x for x in device.parts() if not empty(x.componentCode)
        ][0]

        self.part = repairs.RepairOrderLine()
        self.part.partNumber = os.getenv('GSX_PART',
                                         self.first_part.partNumber)
        self.comptia_code = comptia_codes.get(self.first_part.componentCode, (
            'X01',
            'Memory Module (RAM) - Kernel Panic',
        ))
        self.part.comptiaCode = self.comptia_code[0][0]
        self.part.comptiaModifier = 'A'
예제 #4
0
 def test_whole_unit_exchange(self):
     rep = repairs.WholeUnitExchange()
     rep.serialNumber = ''
     rep.unitReceivedDate = '08/12/2013'
     rep.unitReceivedTime = '11:00 am'
     rep.shipTo = ''
     rep.poNumber = ''
     rep.symptom = 'test'
     rep.diagnosis = 'test'
     customer = repairs.Customer(emailAddress='*****@*****.**')
     customer.firstName = 'First Name'
     customer.lastName = 'Last Name'
     customer.addressLine1 = 'Address Line 1'
     customer.primaryPhone = '0123456789'
     customer.city = 'Test'
     customer.zipCode = '12345'
     customer.state = 'Test'
     customer.country = 'US'
     rep.customerAddress = customer
     part = repairs.RepairOrderLine()
     part.partNumber = '661-5571'
     rep.orderLines = [part]
     rep.create()