Mercurial > treepkg
comparison test/test_debian.py @ 127:e83e96ef12b1
Add treepkg/debian.py and test/test_debian.py with code and tests to
extract soem information from debian/control files
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 22 May 2008 19:13:12 +0000 |
parents | |
children | e1c7cd896310 |
comparison
equal
deleted
inserted
replaced
126:68d829cac3ff | 127:e83e96ef12b1 |
---|---|
1 # Copyright (C) 2008 by Intevation GmbH | |
2 # Authors: | |
3 # Bernhard Herzog <bh@intevation.de> | |
4 # | |
5 # This program is free software under the GPL (>=v2) | |
6 # Read the file COPYING coming with the software for details. | |
7 | |
8 """Tests for treepkg.debian""" | |
9 | |
10 import unittest | |
11 | |
12 from filesupport import FileTestMixin | |
13 | |
14 from treepkg.debian import DebianControlFile | |
15 | |
16 | |
17 class TestDebianControlFile(unittest.TestCase, FileTestMixin): | |
18 | |
19 control_contents = """\ | |
20 Source: libksba | |
21 Section: libs | |
22 Priority: optional | |
23 Maintainer: Kolab-Konsortium Packager <packaging@kolab-konsortium.de> | |
24 Uploaders: Removed for the test | |
25 Build-Depends: debhelper (>= 4.2), libgpg-error-dev (>= 1.2), bison, autotools-dev, cdbs | |
26 Standards-Version: 3.7.2 | |
27 | |
28 Package: libksba-dev | |
29 Section: libdevel | |
30 Architecture: any | |
31 Depends: libksba8 (>= ${Source-Version}) | |
32 Replaces: libksba0 | |
33 Description: Test description | |
34 Some more text. | |
35 . | |
36 Development library files. | |
37 | |
38 Package: libksba8 | |
39 Section: libs | |
40 Architecture: any | |
41 Depends: ${shlibs:Depends}, ${misc:Depends} | |
42 Description: Test description | |
43 Some more text. | |
44 . | |
45 Runtime library files. | |
46 """ | |
47 | |
48 def test(self): | |
49 filename = self.create_temp_file(self.id() + "-control", | |
50 self.control_contents) | |
51 parsed = DebianControlFile(filename) | |
52 self.assertEquals(parsed.packages, | |
53 [('libksba-dev', 'any'), ('libksba8', 'any')]) | |
54 self.assertEquals(parsed.build_depends, | |
55 ['debhelper', 'libgpg-error-dev', 'bison', | |
56 'autotools-dev', 'cdbs']) |