def test_parse(self): header = """Format: 1.0 Source: zippy Section: contrib/net Version: 0.6.6.1-2 Architecture: all Files: 300039c03ecb76239b2d74ade0868311 2676 zippy.diff.gz aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 111 zippy.orig.tar.gz """ package = dsc.parse(header, 'zzz') self.assert_equal(dsc, package.package_type) self.assert_equal('zzz', package.blob_id) self.assertEquals('zippy', package.name) self.assertEquals(None, package.version.epoch) self.assertEquals('0.6.6.1', package.version.version) self.assertEquals('2', package.version.release) self.assertEquals('all', package.arch) expected_files = (('md5:300039c03ecb76239b2d74ade0868311', '2676', 'zippy.diff.gz'), ('md5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '111', 'zippy.orig.tar.gz')) actual_files = package.extra_files self.assert_equals_long(expected_files, actual_files) assert ('pdk', 'raw-filename') not in package
def test_parse(self): header = """Format: 1.0 Source: zippy Section: contrib/net Version: 0.6.6.1-2 Architecture: all Files: 300039c03ecb76239b2d74ade0868311 2676 zippy.diff.gz aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 111 zippy.orig.tar.gz """ package = dsc.parse(header, 'zzz') self.assert_equal(dsc, package.package_type) self.assert_equal('zzz', package.blob_id) self.assertEquals('zippy', package.name) self.assertEquals(None, package.version.epoch) self.assertEquals('0.6.6.1', package.version.version) self.assertEquals('2', package.version.release) self.assertEquals('all', package.arch) expected_files = (('md5:300039c03ecb76239b2d74ade0868311', '2676', 'zippy.diff.gz'), ('md5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '111', 'zippy.orig.tar.gz') ) actual_files = package.extra_files self.assert_equals_long(expected_files, actual_files) assert ('pdk', 'raw-filename') not in package
def test_parse_with_raw_filename(self): header = """Format: 1.0 Package: zippy Section: contrib/net Version: 0.6.6.1-2 Architecture: all Files: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 267 zippy.dsc 300039c03ecb76239b2d74ade0868311 2676 zippy.diff.gz aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 111 zippy.orig.tar.gz """ package = dsc.parse(header, 'zzz') self.assert_equal(dsc, package.package_type) self.assert_equals('zippy.dsc', package.pdk.raw_filename) self.assert_equals(267, package.size)