Exemplo n.º 1
0
    def test_openprinting_unknownprinter(self):
        '''OpenPrintingDriverDB with an unknown printer'''

        backend = jockey.backend.Backend()
        backend.hardware = set(
            [HardwareID('printer_deviceid', 'MFG:FooTech;MDL:X-12;CMD:GDI')])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        backend.update_driverdb()
        self.assertEqual(backend.available(), [])
Exemplo n.º 2
0
    def test_openprinting_unknownprinter(self):
        '''OpenPrintingDriverDB with an unknown printer'''

        backend = jockey.backend.Backend()
        backend.hardware = set([HardwareID('printer_deviceid',
            'MFG:FooTech;MDL:X-12;CMD:GDI')])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        backend.update_driverdb()
        self.assertEqual(backend.available(), [])
Exemplo n.º 3
0
    def test_openprinting_handler_binary(self):
        '''OpenPrintingDriverDB: PrinterDriverHandler for binary package'''

        backend = jockey.backend.Backend()
        backend.hardware = set([HardwareID('printer_deviceid',
            'MFG:EPSON;MDL:Epson ME 320')])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        orig_pkgsys = OSLib.inst.packaging_system
        try:
            OSLib.inst.packaging_system = lambda: 'apt'
            backend.update_driverdb()
        finally:
            OSLib.inst.packaging_system = orig_pkgsys
        handlers = backend.available()
        self.assertEqual(handlers, ['printer:epson-inkjet-printer-n10-nx127:1.0.0'])

        hi = backend.handler_info(handlers[0])
        self.assert_(hi['package'].startswith('epson-inkjet-'))
        self.assert_(hi['repository'].startswith('deb '))
        self.assert_('repository_sign_fp' in hi)
        self.assert_('driver_vendor' in hi)
Exemplo n.º 4
0
    def test_openprinting_handler_ppd(self):
        '''OpenPrintingDriverDB: PrinterDriverHandler for PPD package'''

        backend = jockey.backend.Backend()
        backend.hardware = set([HardwareID('printer_deviceid',
            'MFG:Hewlett-Packard;MDL:HP DesignJet 3500CP')])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        orig_pkgsys = OSLib.inst.packaging_system
        try:
            OSLib.inst.packaging_system = lambda: 'apt'
            backend.update_driverdb()
        finally:
            OSLib.inst.packaging_system = orig_pkgsys
        handlers = backend.available()
        self.assertEqual(handlers, ['printer:openprinting-ppds-postscript-hp:20091009'])

        hi = backend.handler_info(handlers[0])
        self.assertEqual(hi['package'], 'openprinting-ppds-postscript-hp')
        self.assertEqual(hi['free'], 'True')
        self.assert_('repository' in hi)
        self.assert_('driver_vendor' in hi)
Exemplo n.º 5
0
    def test_openprinting_handler_binary(self):
        '''OpenPrintingDriverDB: PrinterDriverHandler for binary package'''

        backend = jockey.backend.Backend()
        backend.hardware = set(
            [HardwareID('printer_deviceid', 'MFG:EPSON;MDL:Epson ME 320')])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        orig_pkgsys = OSLib.inst.packaging_system
        try:
            OSLib.inst.packaging_system = lambda: 'apt'
            backend.update_driverdb()
        finally:
            OSLib.inst.packaging_system = orig_pkgsys
        handlers = backend.available()
        self.assertEqual(len(handlers), 1)
        self.assertTrue(
            handlers[0].startswith('printer:epson-inkjet-printer-n10-nx127:1'))

        hi = backend.handler_info(handlers[0])
        self.assert_(hi['package'].startswith('epson-inkjet-'))
        self.assert_(hi['repository'].startswith('deb '))
        self.assert_('repository_sign_fp' in hi)
        self.assert_('driver_vendor' in hi)
Exemplo n.º 6
0
    def test_openprinting_handler_ppd(self):
        '''OpenPrintingDriverDB: PrinterDriverHandler for PPD package'''

        backend = jockey.backend.Backend()
        backend.hardware = set([
            HardwareID('printer_deviceid',
                       'MFG:Hewlett-Packard;MDL:HP DesignJet 3500CP')
        ])
        backend.driver_dbs.append(jockey.detection.OpenPrintingDriverDB())
        orig_pkgsys = OSLib.inst.packaging_system
        try:
            OSLib.inst.packaging_system = lambda: 'apt'
            backend.update_driverdb()
        finally:
            OSLib.inst.packaging_system = orig_pkgsys
        handlers = backend.available()
        self.assertEqual(handlers,
                         ['printer:openprinting-ppds-postscript-hp:20091009'])

        hi = backend.handler_info(handlers[0])
        self.assertEqual(hi['package'], 'openprinting-ppds-postscript-hp')
        self.assertEqual(hi['free'], 'True')
        self.assert_('repository' in hi)
        self.assert_('driver_vendor' in hi)