コード例 #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'))