annotate test/test_debian.py @ 128:5155b4f9443d

Add basic dependency handling to PackageTrack and PackagerGroup. PackageTrack now extracts dependency information from the debian/control file and PackagerGroup sorts the tracks based on this information so that packages on which other packages in the group depend on are built first and their newly built binaries are installed added to the pbuilder instance. Also add some test cases.
author Bernhard Herzog <bh@intevation.de>
date Fri, 23 May 2008 16:11:22 +0000
parents e83e96ef12b1
children e1c7cd896310
rev   line source
127
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
1 # Copyright (C) 2008 by Intevation GmbH
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
2 # Authors:
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
3 # Bernhard Herzog <bh@intevation.de>
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
4 #
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
5 # This program is free software under the GPL (>=v2)
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
6 # Read the file COPYING coming with the software for details.
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
7
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
8 """Tests for treepkg.debian"""
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
9
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
10 import unittest
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
11
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
12 from filesupport import FileTestMixin
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
13
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
14 from treepkg.debian import DebianControlFile
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
15
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
16
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
17 class TestDebianControlFile(unittest.TestCase, FileTestMixin):
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
18
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
19 control_contents = """\
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
20 Source: libksba
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
21 Section: libs
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
22 Priority: optional
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
23 Maintainer: Kolab-Konsortium Packager <packaging@kolab-konsortium.de>
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
24 Uploaders: Removed for the test
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
25 Build-Depends: debhelper (>= 4.2), libgpg-error-dev (>= 1.2), bison, autotools-dev, cdbs
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
26 Standards-Version: 3.7.2
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
27
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
28 Package: libksba-dev
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
29 Section: libdevel
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
30 Architecture: any
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
31 Depends: libksba8 (>= ${Source-Version})
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
32 Replaces: libksba0
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
33 Description: Test description
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
34 Some more text.
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
35 .
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
36 Development library files.
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
37
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
38 Package: libksba8
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
39 Section: libs
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
40 Architecture: any
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
41 Depends: ${shlibs:Depends}, ${misc:Depends}
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
42 Description: Test description
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
43 Some more text.
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
44 .
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
45 Runtime library files.
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
46 """
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
47
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
48 def test(self):
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
49 filename = self.create_temp_file(self.id() + "-control",
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
50 self.control_contents)
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
51 parsed = DebianControlFile(filename)
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
52 self.assertEquals(parsed.packages,
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
53 [('libksba-dev', 'any'), ('libksba8', 'any')])
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
54 self.assertEquals(parsed.build_depends,
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
55 ['debhelper', 'libgpg-error-dev', 'bison',
e83e96ef12b1 Add treepkg/debian.py and test/test_debian.py with code and tests to
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
56 'autotools-dev', 'cdbs'])
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)