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 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. 3
0
class TestOnsiteCoverage(RemoteTestCase):
    def setUp(self):
        super(TestOnsiteCoverage, self).setUp()
        self.product = Product(os.getenv('GSX_SN'))
        self.product.warranty()

    def test_has_onsite(self):
        self.assertTrue(self.product.has_onsite)

    def test_coverage(self):
        self.assertTrue(self.product.parts_and_labor_covered)

    def test_is_vintage(self):
        self.assertFalse(self.product.is_vintage)
Esempio n. 4
0
class TestOnsiteCoverage(RemoteTestCase):
    def setUp(self):
        super(TestOnsiteCoverage, self).setUp()
        self.product = Product(os.getenv('GSX_SN'))
        self.product.warranty()

    def test_has_onsite(self):
        self.assertTrue(self.product.has_onsite)

    def test_coverage(self):
        self.assertTrue(self.product.parts_and_labor_covered)

    def test_is_vintage(self):
        self.assertFalse(self.product.is_vintage)
Esempio n. 5
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. 6
0
class TestRemoteWarrantyFunctions(TestCase):
    @classmethod
    def setUpClass(cls):
        connect(os.getenv('GSX_USER'), os.getenv('GSX_SOLDTO'), os.getenv('GSX_ENV'))

    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'))

    def test_repair_strategies(self):
        self.assertEqual(self.product.repair_strategies[0], 'Carry-in')

    def test_acplus_status(self):
        self.assertTrue(self.wty.acPlusFlag)

    def test_warranty_lookup(self):
        self.assertEqual(self.wty.warrantyStatus, 'Out Of Warranty (No Coverage)')

    def test_warranty_lookup_imei(self):
        wty = Product(os.getenv('GSX_IMEI')).warranty()
        self.assertEqual(wty.warrantyStatus, 'Out Of Warranty (No Coverage)')

    def test_fmip_active(self):
        self.assertTrue(self.product.fmip_is_active)
Esempio n. 7
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. 8
0
class TestRemoteWarrantyFunctions(TestCase):
    @classmethod
    def setUpClass(cls):
        connect(os.getenv('GSX_USER'), os.getenv('GSX_SOLDTO'),
                os.getenv('GSX_ENV'))

    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'))

    def test_repair_strategies(self):
        self.assertEqual(self.product.repair_strategies[0], 'Carry-in')

    def test_acplus_status(self):
        self.assertTrue(self.wty.acPlusFlag)

    def test_warranty_lookup(self):
        self.assertEqual(self.wty.warrantyStatus,
                         'Out Of Warranty (No Coverage)')

    def test_warranty_lookup_imei(self):
        wty = Product(os.getenv('GSX_IMEI')).warranty()
        self.assertEqual(wty.warrantyStatus, 'Out Of Warranty (No Coverage)')

    def test_fmip_active(self):
        self.assertTrue(self.product.fmip_is_active)
Esempio n. 9
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. 10
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. 11
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. 12
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. 13
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
Esempio n. 14
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(env['GSX_SN'])
     self.product.warranty()
Esempio n. 15
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. 16
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. 17
0
 def test_product_parts(self):
     parts = Product(os.getenv('GSX_SN')).parts()
     self.assertIsInstance(parts[0].partNumber, str)
Esempio n. 18
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. 19
0
 def test_product_parts(self):
     parts = Product(env['GSX_SN']).parts()
     self.assertIsInstance(parts[0].partNumber, basestring)
Esempio n. 20
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. 21
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
Esempio n. 22
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. 23
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'))