Esempio n. 1
0
 def test_product_image(self):
     product = Product(os.getenv('GSX_SN', '123456789'))
     product.description = 'MacBook Air (13-inch min 2013)'
     img = product.fetch_image(
         'https://static.servoapp.com/images/products/macbook-air-13-inchmid-2013.jpg'
     )
     self.assertTrue(os.path.exists(img))
Esempio n. 2
0
 def setUp(self):
     connect(os.getenv('GSX_USER'), os.getenv('GSX_SOLDTO'),
             os.getenv('GSX_ENV'))
     self.sn = os.getenv('GSX_SN')
     device = Product(sn=self.sn)
     self.diag = diagnostics.Diagnostics(serialNumber=self.sn)
     self.diag.shipTo = os.getenv('GSX_SHIPTO')
     suites = self.diag.fetch_suites()
     self.suite = suites[0]
Esempio n. 3
0
 def test_product_type(self):
     product = Product('DGKFL06JDHJP')
     product.description = 'MacBook Pro (17-inch, Mid 2009)'
     self.assertTrue(product.is_mac)
     product.description = 'iMac (27-inch, Late 2013)'
     self.assertTrue(product.is_mac)
     product.description = 'iPhone 5'
     self.assertTrue(product.is_iphone)
     product.description = 'iPad 2 3G'
     self.assertTrue(product.is_ipad)
     self.assertTrue(product.is_ios)
Esempio n. 4
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'
Esempio n. 5
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'
Esempio n. 6
0
    def test_unlocked(self):
        self.assertIs(type(self.data.unlocked), bool)
        self.assertTrue(self.data.unlocked)

        p = Product(os.getenv('GSX_SN'))
        self.assertTrue(p.is_unlocked(self.data))
Esempio n. 7
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
Esempio n. 8
0
 def test_warranty_lookup_imei(self):
     wty = Product(os.getenv('GSX_IMEI')).warranty()
     self.assertEqual(wty.warrantyStatus, 'Out Of Warranty (No Coverage)')
Esempio n. 9
0
 def setUp(self):
     super(TestRemoteWarrantyFunctions, self).setUp()
     self.sn = os.getenv('GSX_SN')
     device = Product(sn=self.sn)
     self.product = Product(os.getenv('GSX_SN'))
     self.wty = self.product.warranty(ship_to=os.getenv('GSX_SHIPTO'))
Esempio n. 10
0
 def test_product_parts(self):
     parts = Product(os.getenv('GSX_SN')).parts()
     self.assertIsInstance(parts[0].partNumber, str)
Esempio n. 11
0
    def test_unlocked(self):
        self.assertIs(type(self.data.unlocked), bool)
        self.assertTrue(self.data.unlocked)

        p = Product(env['GSX_SN'])
        self.assertTrue(p.is_unlocked(self.data))
Esempio n. 12
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(env['GSX_SN'])
     self.product.warranty()
Esempio n. 13
0
 def test_product_parts(self):
     parts = Product(env['GSX_SN']).parts()
     self.assertIsInstance(parts[0].partNumber, basestring)