コード例 #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))
コード例 #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]
コード例 #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)
コード例 #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'
コード例 #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'
コード例 #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))
コード例 #7
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
コード例 #8
0
 def test_warranty_lookup_imei(self):
     wty = Product(os.getenv('GSX_IMEI')).warranty()
     self.assertEqual(wty.warrantyStatus, 'Out Of Warranty (No Coverage)')
コード例 #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'))
コード例 #10
0
 def test_product_parts(self):
     parts = Product(os.getenv('GSX_SN')).parts()
     self.assertIsInstance(parts[0].partNumber, str)
コード例 #11
0
ファイル: test_gsxws.py プロジェクト: mayavi/py-gsxws
    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))
コード例 #12
0
ファイル: test_gsxws.py プロジェクト: mayavi/py-gsxws
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(env['GSX_SN'])
     self.product.warranty()
コード例 #13
0
ファイル: test_gsxws.py プロジェクト: mayavi/py-gsxws
 def test_product_parts(self):
     parts = Product(env['GSX_SN']).parts()
     self.assertIsInstance(parts[0].partNumber, basestring)