Example #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))
Example #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)
Example #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)
Example #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)
Example #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'
Example #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)
Example #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'
Example #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)
Example #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]
Example #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'
Example #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)
Example #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))
Example #13
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
Example #14
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(env['GSX_SN'])
     self.product.warranty()
Example #15
0
 def test_warranty_lookup_imei(self):
     wty = Product(os.getenv('GSX_IMEI')).warranty()
     self.assertEqual(wty.warrantyStatus, 'Out Of Warranty (No Coverage)')
Example #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'))
Example #17
0
 def test_product_parts(self):
     parts = Product(os.getenv('GSX_SN')).parts()
     self.assertIsInstance(parts[0].partNumber, str)
Example #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))
Example #19
0
 def test_product_parts(self):
     parts = Product(env['GSX_SN']).parts()
     self.assertIsInstance(parts[0].partNumber, basestring)
Example #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))
Example #21
0
 def setUp(self):
     super(TestOnsiteCoverage, self).setUp()
     self.product = Product(os.getenv('GSX_SN'))
     self.product.warranty()
Example #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))
Example #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'))