예제 #1
0
파일: external.py 프로젝트: wking/layman
    def list_db(self):
        output = Message()
        config = {
                  'output': output,
                  'svn_command': '/usr/bin/svn',
                  'rsync_command':'/usr/bin/rsync'
                 }
        db = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ])

        test_info = ('wrobel\n~~~~~~\nSource  : '\
                     'https://overlays.gentoo.org/svn/dev/wrobel\nContact : '\
                     '[email protected]\nType    : Subversion; Priority: 10\n'\
                     'Quality : experimental\n\nDescription:\n  Test\n',
                     'wrobel-stable\n~~~~~~~~~~~~~\nSource  : '\
                     'rsync://gunnarwrobel.de/wrobel-stable\nContact : '\
                     '[email protected]\nType    : Rsync; Priority: 50\n'\
                     'Quality : experimental\n\nDescription:\n  A collection '\
                     'of ebuilds from Gunnar Wrobel [[email protected]].\n')

        info = db.list(verbose=True)

        for i in range(0, len(info)):
            self.assertEqual(info[i][0].decode('utf-8'), test_info[i])
            print(info[i][0].decode('utf-8'))

        test_info = ('wrobel                    [Subversion] '\
                     '(https://o.g.o/svn/dev/wrobel         )',
                     'wrobel-stable             [Rsync     ] '\
                     '(rsync://gunnarwrobel.de/wrobel-stable)')

        info = db.list(verbose=False, width=80)
        for i in range(0, len(info)):
            self.assertEqual(info[i][0].decode('utf-8'), test_info[i])
            print(info[i][0].decode('utf-8'))
예제 #2
0
파일: external.py 프로젝트: jmesmon/layman
 def _overlays_bug(self, number):
     config = BareConfig()
     filename = os.path.join(HERE, 'testfiles', 'overlays_bug_%d.xml' % number)
     o = DbBase(config, [filename])
     for verbose in (True, False):
         for t in o.list(verbose=verbose):
             print t[0]
             print
예제 #3
0
 def _overlays_bug(self, number):
     config = BareConfig()
     filename = os.path.join(HERE, 'testfiles', 'overlays_bug_%d.xml'\
                                                 % number)
     o = DbBase(config, [filename])
     for verbose in (True, False):
         for t in o.list(verbose=verbose):
             print(t[0].decode('utf-8'))
             print()
예제 #4
0
    def list_db(self):
        output = Message()
        config = {
            'output': output,
            'db_type': 'xml',
            'svn_command': '/usr/bin/svn',
            'rsync_command': '/usr/bin/rsync'
        }
        db = DbBase(config, [
            HERE + '/testfiles/global-overlays.xml',
        ])

        test_info = ('wrobel\n~~~~~~\nSource  : '\
                     'https://overlays.gentoo.org/svn/dev/wrobel\nContact : '\
                     '[email protected]\nType    : Subversion; Priority: 10\n'\
                     'Quality : experimental\n\nDescription:\n  Test\n',
                     'wrobel-stable\n~~~~~~~~~~~~~\nSource  : '\
                     'rsync://gunnarwrobel.de/wrobel-stable\nContact : '\
                     '[email protected]\nType    : Rsync; Priority: 50\n'\
                     'Quality : experimental\n\nDescription:\n  A collection '\
                     'of ebuilds from Gunnar Wrobel [[email protected]].\n')

        info = db.list(verbose=True)

        for i in range(0, len(info)):
            self.assertEqual(info[i][0].decode('utf-8'), test_info[i])
            print(info[i][0].decode('utf-8'))

        test_info = ('wrobel                    [Subversion] '\
                     '(https://o.g.o/svn/dev/wrobel         )',
                     'wrobel-stable             [Rsync     ] '\
                     '(rsync://gunnarwrobel.de/wrobel-stable)')

        info = db.list(verbose=False, width=80)
        for i in range(0, len(info)):
            self.assertEqual(info[i][0].decode('utf-8'), test_info[i])
            print(info[i][0].decode('utf-8'))