comparison test/test_debian.py @ 196:86ea689eda5f

Extend debian/control file parser to cope with more real-world file. Add some test cases.
author Bernhard Herzog <bh@intevation.de>
date Fri, 01 Aug 2008 19:54:58 +0000
parents e1c7cd896310
children b1525ac52e27
comparison
equal deleted inserted replaced
195:e3ab8aca2b08 196:86ea689eda5f
51 self.assertEquals(parsed.packages, 51 self.assertEquals(parsed.packages,
52 [('libksba-dev', 'any'), ('libksba8', 'any')]) 52 [('libksba-dev', 'any'), ('libksba8', 'any')])
53 self.assertEquals(parsed.build_depends, 53 self.assertEquals(parsed.build_depends,
54 ['debhelper', 'libgpg-error-dev', 'bison', 54 ['debhelper', 'libgpg-error-dev', 'bison',
55 'autotools-dev', 'cdbs']) 55 'autotools-dev', 'cdbs'])
56
57
58 class TestDebianControlFileBuildDepsWithContinuation(unittest.TestCase,
59 FileTestMixin):
60
61 control_contents = """\
62 Source: kdebase
63 Section: kde
64 Priority: optional
65 Maintainer: Kolab-Konsortium Packager <packaging@kolab-konsortium.de>
66 Build-Depends: cdbs (>= 0.4.51), debhelper (>= 6), quilt, cmake (>= 2.4.5),
67 kdepimlibs5-dev (>= 4:4.0.84), libphonon-dev (>= 4:4.2~),
68 libplasma-dev (>= 4:4.0.84), libqimageblitz-dev (>= 1:0.0.4-2),
69 libsmbclient-dev, libusb-dev, libxkbfile-dev, libraw1394-dev,
70 libstreamanalyzer-dev, libxrender-dev, zlib1g-dev, libglu1-mesa-dev,
71 libpci-dev, libxt-dev, libxext-dev, pkg-config, libglib2.0-dev
72 Standards-Version: 3.7.3
73
74 Package: kdebase
75 Section: kde
76 Architecture: all
77 Description: base applications from the official KDE release
78 """
79
80 def test(self):
81 filename = self.create_temp_file("control", self.control_contents)
82 parsed = DebianControlFile(filename)
83 self.assertEquals(parsed.packages,
84 [('kdebase', 'all')])
85 self.assertEquals(parsed.build_depends,
86 ['cdbs', 'debhelper', 'quilt', 'cmake',
87 'kdepimlibs5-dev', 'libphonon-dev', 'libplasma-dev',
88 'libqimageblitz-dev', 'libsmbclient-dev',
89 'libusb-dev', 'libxkbfile-dev', 'libraw1394-dev',
90 'libstreamanalyzer-dev', 'libxrender-dev',
91 'zlib1g-dev', 'libglu1-mesa-dev', 'libpci-dev',
92 'libxt-dev', 'libxext-dev', 'pkg-config',
93 'libglib2.0-dev'])
94
95
96 class TestDebianControlFileWithComments(unittest.TestCase, FileTestMixin):
97
98 control_contents = """\
99 Source: kdebase
100 Section: kde
101 Priority: optional
102 Maintainer: Kolab-Konsortium Packager <packaging@kolab-konsortium.de>
103 Build-Depends: cdbs (>= 0.4.51), debhelper (>= 6), quilt, cmake (>= 2.4.5),
104 kdepimlibs5-dev (>= 4:4.0.84), libphonon-dev (>= 4:4.2~), libplasma-dev (>= 4:4.0.84),
105 libqimageblitz-dev (>= 1:0.0.4-2), libsmbclient-dev, libusb-dev, libxkbfile-dev,
106 libraw1394-dev, libstreamanalyzer-dev, libxrender-dev, zlib1g-dev, libglu1-mesa-dev,
107 libpci-dev, libxt-dev, libxext-dev, pkg-config, libglib2.0-dev
108 Standards-Version: 3.7.3
109
110 # commented out
111 # Package: foo
112 # Section: kde
113 # Architecture: all
114
115 Package: kdebase
116 Section: kde
117 Architecture: all
118 Description: base applications from the official KDE release
119 """
120
121 def test(self):
122 filename = self.create_temp_file("control", self.control_contents)
123 parsed = DebianControlFile(filename)
124 self.assertEquals(parsed.packages,
125 [('kdebase', 'all')])
126 self.assertEquals(parsed.build_depends,
127 ['cdbs', 'debhelper', 'quilt', 'cmake',
128 'kdepimlibs5-dev', 'libphonon-dev', 'libplasma-dev',
129 'libqimageblitz-dev', 'libsmbclient-dev',
130 'libusb-dev', 'libxkbfile-dev', 'libraw1394-dev',
131 'libstreamanalyzer-dev', 'libxrender-dev',
132 'zlib1g-dev', 'libglu1-mesa-dev', 'libpci-dev',
133 'libxt-dev', 'libxext-dev', 'pkg-config',
134 'libglib2.0-dev'])
135
136
137 class TestDebianControlFileWithExtraEmptyLines(unittest.TestCase,
138 FileTestMixin):
139
140 control_contents = """\
141 Source: kdebase
142 Section: kde
143 Priority: optional
144 Maintainer: Kolab-Konsortium Packager <packaging@kolab-konsortium.de>
145 Build-Depends: cdbs (>= 0.4.51), debhelper (>= 6), quilt, cmake (>= 2.4.5),
146 kdepimlibs5-dev (>= 4:4.0.84), libphonon-dev (>= 4:4.2~), libplasma-dev (>= 4:4.0.84),
147 libqimageblitz-dev (>= 1:0.0.4-2), libsmbclient-dev, libusb-dev, libxkbfile-dev,
148 libraw1394-dev, libstreamanalyzer-dev, libxrender-dev, zlib1g-dev, libglu1-mesa-dev,
149 libpci-dev, libxt-dev, libxext-dev, pkg-config, libglib2.0-dev
150 Standards-Version: 3.7.3
151
152
153 Package: kdebase
154 Section: kde
155 Architecture: all
156 Description: base applications from the official KDE release
157
158 """
159
160 def test(self):
161 filename = self.create_temp_file("control", self.control_contents)
162 parsed = DebianControlFile(filename)
163 self.assertEquals(parsed.packages,
164 [('kdebase', 'all')])
165 self.assertEquals(parsed.build_depends,
166 ['cdbs', 'debhelper', 'quilt', 'cmake',
167 'kdepimlibs5-dev', 'libphonon-dev', 'libplasma-dev',
168 'libqimageblitz-dev', 'libsmbclient-dev',
169 'libusb-dev', 'libxkbfile-dev', 'libraw1394-dev',
170 'libstreamanalyzer-dev', 'libxrender-dev',
171 'zlib1g-dev', 'libglu1-mesa-dev', 'libpci-dev',
172 'libxt-dev', 'libxext-dev', 'pkg-config',
173 'libglib2.0-dev'])
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)