From 50ac0c04ea5497c653f3941050f488da6da2c32f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 20 May 2016 09:27:41 +0200 Subject: [PATCH] Add a couple of check_dsc_files tests Signed-off-by: Julien Cristau --- tests/fixtures/dsc/10.dsc | 48 +++++++++++++++++++++++++++++++++++++ tests/test_parse_changes.py | 14 +++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/dsc/10.dsc diff --git a/tests/fixtures/dsc/10.dsc b/tests/fixtures/dsc/10.dsc new file mode 100644 index 00000000..82e00a72 --- /dev/null +++ b/tests/fixtures/dsc/10.dsc @@ -0,0 +1,48 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 1.0 +Source: xserver-xorg-input-evdev +Binary: xserver-xorg-input-evdev, xserver-xorg-input-evdev-udeb, xserver-xorg-input-evdev-dev, xserver-xorg-input-evdev-dbg +Architecture: linux-any all +Version: 1:2.10.2-1 +Maintainer: Debian X Strike Force +Standards-Version: 3.9.5 +Vcs-Browser: https://anonscm.debian.org/git/pkg-xorg/driver/xserver-xorg-input-evdev.git +Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/driver/xserver-xorg-input-evdev.git +Build-Depends: debhelper (>= 8), dh-autoreconf, pkg-config, quilt, xserver-xorg-dev (>= 2:1.15.99), x11proto-core-dev, x11proto-randr-dev, x11proto-input-dev (>= 2.1.99.3), x11proto-kb-dev, libxkbfile-dev, xutils-dev (>= 1:7.5+4), libudev-dev, libmtdev-dev, libevdev-dev (>= 1.2.2+dfsg-1~) +Package-List: + xserver-xorg-input-evdev deb x11 optional arch=linux-any + xserver-xorg-input-evdev-dbg deb debug extra arch=linux-any + xserver-xorg-input-evdev-dev deb libdevel optional arch=all + xserver-xorg-input-evdev-udeb udeb debian-installer optional arch=linux-any +Checksums-Sha1: + c740040cf11256cd9a6d15ae414e15b19c885483 497697 xserver-xorg-input-evdev_2.10.2.orig.tar.gz + b22681c43c3c3c2e2dc01d14cb97dee92c0713f1 230 xserver-xorg-input-evdev_2.10.2.orig.tar.gz.asc + fc2793586c9d4c8158b2009f302e3e206fc52ef1 11220 xserver-xorg-input-evdev_2.10.2-1.diff.gz +Checksums-Sha256: + c7b81cdaa3d1263d38f6f7f5048d0d547bdc3ee9331e39345000a584695b197b 497697 xserver-xorg-input-evdev_2.10.2.orig.tar.gz + cebe3944af43b4a3f37c71f0778536a193da6e7641b4347ca7e9b3f360173800 230 xserver-xorg-input-evdev_2.10.2.orig.tar.gz.asc + 1a4069f6472092bd40c5cbc2bb379fa96cf195334edf930e88f4a41d5e7f9ba3 11220 xserver-xorg-input-evdev_2.10.2-1.diff.gz +Files: + e3bc0dd7ae801c6b67c0742389cb4869 497697 xserver-xorg-input-evdev_2.10.2.orig.tar.gz + a9ba0e416eeac3245b22ceac0e68f805 230 xserver-xorg-input-evdev_2.10.2.orig.tar.gz.asc + c9703acf7e73c7e9984f1e8506ce82bf 11220 xserver-xorg-input-evdev_2.10.2-1.diff.gz + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQIcBAEBCAAGBQJXPi46AAoJEJ2wI1VW+M+tEIAP/j3aG3yRzOdbuLlVxVhHJeBz +k2FxsmbwWMEeKqPVuormnkDm0ZxQ4BAWlFFlHpId2jcILvvZnzcjfPD4Np1ZyV5b +pJvhIk8CxNkYau7dv763reMa9P9naHyrBuIdAlcHVdil1KzQcepT+vSZHoJndQh2 +PDtAjU4zIzrcjwWVj5JqYG2jCHY8vafz66sR8E9FbY08aa7XkPkXv8Fd6XIRSN8y +fSPjDqTrI8AbQy2I8iFxmjAYscLsDJ1bQUcZHeI+DoG9cNkiN7m5jQuvP4Ncftp/ +YTRPfDxiLsA1En1hGMlb/oacyrgC72FYtCunHohQC3WED+zM1LFc9fp9METHW4Wo +CGw898bVB8mX8pjC03Ffqp2c3we1Ih+rQTwuKWEEVX19vetOoBj/24gdSeKiHvE5 +p2ZDr6WW46G29F1F/rF+qVsKyXaISZzlFQyFjkgKHfRmvH/ZrvM/YJ2aCtmBYMNJ +fD9I2uFR7t8WkBw1/12MSs3OEEhKv4+c5lqTICoI3Yif1tWqrnOwPe5UH1VrDeTi +aBgNFLXRZNAqNEs0u9RB5kfoKpfdhWAno++ddHqc4rBQWOPIBKuCwXVlNbMLseDq +5ys/QR85FCx1LUVhmJ3eAMSFsYFvdQoxxM5jXiejx1ejF8QBq/KozyoCo2ogcPdL +3Kb93/rP8k28bUmt0mK4 +=PJ2R +-----END PGP SIGNATURE----- diff --git a/tests/test_parse_changes.py b/tests/test_parse_changes.py index c7193dbe..f93b67c9 100755 --- a/tests/test_parse_changes.py +++ b/tests/test_parse_changes.py @@ -5,7 +5,7 @@ from base_test import DakTestCase, fixture import unittest from daklib.gpg import GpgException -from daklib.utils import parse_changes +from daklib.utils import parse_changes, check_dsc_files, build_file_list from daklib.dak_exceptions import InvalidDscError, ParseChangesError class ParseChangesTestCase(DakTestCase): @@ -14,7 +14,10 @@ class ParseChangesTestCase(DakTestCase): class ParseDscTestCase(ParseChangesTestCase): def test_1(self): - self.assertParse('dsc/1.dsc', -1, 1) + changes = self.assertParse('dsc/1.dsc', -1, 1) + files = build_file_list(changes, 1) + rejmsg = check_dsc_files('1.dsc', changes, files.keys()) + self.assertEqual(rejmsg, []) def test_1_ignoreErrors(self): # Valid .dsc ; ignoring errors @@ -60,6 +63,13 @@ class ParseDscTestCase(ParseChangesTestCase): self.assert_(changes['question'] == 'Is this a bug?') self.failIf(changes.get('this')) + def test_10(self): + changes = self.assertParse('dsc/10.dsc', -1, 1) + files = build_file_list(changes, 1) + rejmsg = check_dsc_files('10.dsc', changes, files.keys()) + self.assertEqual(rejmsg, []) + + class ParseChangesTestCase(ParseChangesTestCase): def test_1(self): # Empty changes -- 2.39.5