Esempio n. 1
0
    def test_parse(self):
        header = """Package: name
Depends: z
Version: 0:2-3
Architecture: i386
Replaces: y
Description: abc
 def
  ghi
 jkl mno

"""
        package = deb.parse(header, 'zzz')
        self.assert_equal(deb, package.package_type)
        self.assert_equal('zzz', package.blob_id)
        self.assertEquals('name', package.name)
        self.assertEquals('0', package.version.epoch)
        self.assertEquals('2', package.version.version)
        self.assertEquals('3', package.version.release)
        self.assertEquals('i386', package.arch)
        self.assertEquals('name', package.pdk.sp_name)
        self.assertEquals('0', package.pdk.sp_version.epoch)
        self.assertEquals('2', package.pdk.sp_version.version)
        self.assertEquals('3', package.pdk.sp_version.release)
        self.assert_equals('y', package['deb', 'Replaces'])
Esempio n. 2
0
    def test_parse(self):
        header = """Package: name
Depends: z
Version: 0:2-3
Architecture: i386
Replaces: y
Description: abc
 def
  ghi
 jkl mno

"""
        package = deb.parse(header, 'zzz')
        self.assert_equal(deb, package.package_type)
        self.assert_equal('zzz', package.blob_id)
        self.assertEquals('name', package.name)
        self.assertEquals('0', package.version.epoch)
        self.assertEquals('2', package.version.version)
        self.assertEquals('3', package.version.release)
        self.assertEquals('i386', package.arch)
        self.assertEquals('name', package.pdk.sp_name)
        self.assertEquals('0', package.pdk.sp_version.epoch)
        self.assertEquals('2', package.pdk.sp_version.version)
        self.assertEquals('3', package.pdk.sp_version.release)
        self.assert_equals('y', package['deb', 'Replaces'])
Esempio n. 3
0
    def test_has_source(self):
        header = """Package: name
Depends: z
Version: 1
Architecture: i386
Source: a
Description: asdf
 One fine day
 there was some stuff.
 .
 Then more stuff.

"""
        package = deb.parse(header, 'zzz')
        self.assertEquals('a', package[('pdk', 'sp-name')])
Esempio n. 4
0
    def test_has_source(self):
        header = """Package: name
Depends: z
Version: 1
Architecture: i386
Source: a
Description: asdf
 One fine day
 there was some stuff.
 .
 Then more stuff.

"""
        package = deb.parse(header, 'zzz')
        self.assertEquals('a', package[('pdk', 'sp-name')])
Esempio n. 5
0
    def test_has_source_version(self):
        header = """Package: name
Depends: z
Version: 1
Architecture: i386
Source: a (0.24-3.2)
Description: asdf
 One fine day
 there was some stuff.
 .
 Then more stuff.

"""
        package = deb.parse(header, 'zzz')
        self.assertEquals('a', package[('pdk', 'sp-name')])
        self.assertEquals(None, package.pdk.sp_version.epoch)
        self.assertEquals('0.24', package.pdk.sp_version.version)
        self.assertEquals('3.2', package.pdk.sp_version.release)
Esempio n. 6
0
    def test_has_source_version(self):
        header = """Package: name
Depends: z
Version: 1
Architecture: i386
Source: a (0.24-3.2)
Description: asdf
 One fine day
 there was some stuff.
 .
 Then more stuff.

"""
        package = deb.parse(header, 'zzz')
        self.assertEquals('a', package[('pdk', 'sp-name')])
        self.assertEquals(None, package.pdk.sp_version.epoch)
        self.assertEquals('0.24', package.pdk.sp_version.version)
        self.assertEquals('3.2', package.pdk.sp_version.release)