diff test/test_packager.py @ 367:fb92f3c1b238

treepkg is now able to handle debian source format 1.0 and source format 3.0 (quilt)
author Bjoern Ricks <bricks@intevation.de>
date Mon, 31 May 2010 10:20:25 +0000
parents f06f707d9fda
children ca95be9d033a
line wrap: on
line diff
--- a/test/test_packager.py	Mon May 31 09:54:31 2010 +0000
+++ b/test/test_packager.py	Mon May 31 10:20:25 2010 +0000
@@ -263,6 +263,114 @@
                           [("702432", "2"), ("704195", "0")])
 
 
+class TestSourcePackager(unittest.TestCase, FileTestMixin):
+
+    def test_debian_source_format_3_0_1(self):
+        trackdir = self.create_files("track",
+                                     [("debian",
+                                       [("source",
+                                         [("format", ("3.0 (quilt)"))]
+                                       )]
+                                     ),
+                                     ("pkg",
+                                       [("704195-0",
+                                         [("status", 
+                                            ("TreePackagerStatus 0.0\n"
+                                            "status: binary_package_created\n"
+                                            "start: 2007-09-10 17:16:48\n"
+                                            "stop: 2007-09-11 00:07:36\n")),
+                                          ("src", []),
+                                          ("binary", [])
+                                         ]
+                                        )]
+                                      )]
+                                   )
+        track = PackageTrack("testtrack", trackdir, "", "", "", "", "")
+        revpkg = RevisionPackager(track, 704195, 0)
+        srcpkg = SourcePackager(revpkg)
+
+        pkgbasedir = trackdir
+        format = srcpkg.get_debian_source_format(pkgbasedir)
+        self.assertEqual("3.0 (quilt)", format)
+
+    def test_debian_source_format_3_0_2(self):
+        trackdir = self.create_files("track",
+                                     [("debian",
+                                       [("source",
+                                         [("format", ("3.0 (quilt)\nabc"))]
+                                       )]
+                                     ),
+                                     ("pkg",
+                                       [("704195-0",
+                                         [("status",
+                                            ("TreePackagerStatus 0.0\n"
+                                            "status: binary_package_created\n"
+                                            "start: 2007-09-10 17:16:48\n"
+                                            "stop: 2007-09-11 00:07:36\n")),
+                                          ("src", []),
+                                          ("binary", [])
+                                         ]
+                                        )]
+                                      )]
+                                   )
+        track = PackageTrack("testtrack", trackdir, "", "", "", "", "")
+        revpkg = RevisionPackager(track, 704195, 0)
+        srcpkg = SourcePackager(revpkg)
+
+        pkgbasedir = trackdir
+        format = srcpkg.get_debian_source_format(pkgbasedir)
+        self.assertEqual("3.0 (quilt)", format)
+
+    def test_debian_source_format_1_0_1(self):
+        trackdir = self.create_files("track",
+                                     [("debian",
+                                       [("source","")]
+                                     ),
+                                     ("pkg",
+                                       [("704195-0",
+                                         [("status",
+                                            ("TreePackagerStatus 0.0\n"
+                                            "status: binary_package_created\n"
+                                            "start: 2007-09-10 17:16:48\n"
+                                            "stop: 2007-09-11 00:07:36\n")),
+                                          ("src", []),
+                                          ("binary", [])
+                                         ]
+                                        )]
+                                      )]
+                                   )
+        track = PackageTrack("testtrack", trackdir, "", "", "", "", "")
+        revpkg = RevisionPackager(track, 704195, 0)
+        srcpkg = SourcePackager(revpkg)
+
+        pkgbasedir = trackdir
+        format = srcpkg.get_debian_source_format(pkgbasedir)
+        self.assertEqual("1.0", format)
+
+    def test_debian_source_format_1_0_2(self):
+        trackdir = self.create_files("track",
+                                     [("debian", ""),
+                                     ("pkg",
+                                       [("704195-0",
+                                         [("status",
+                                            ("TreePackagerStatus 0.0\n"
+                                            "status: binary_package_created\n"
+                                            "start: 2007-09-10 17:16:48\n"
+                                            "stop: 2007-09-11 00:07:36\n")),
+                                          ("src", []),
+                                          ("binary", [])
+                                         ]
+                                        )]
+                                      )]
+                                   )
+        track = PackageTrack("testtrack", trackdir, "", "", "", "", "")
+        revpkg = RevisionPackager(track, 704195, 0)
+        srcpkg = SourcePackager(revpkg)
+
+        pkgbasedir = trackdir
+        format = srcpkg.get_debian_source_format(pkgbasedir)
+        self.assertEqual("1.0", format)
+
 class TestRevisionPackager(unittest.TestCase, FileTestMixin):
 
     def test_list_source_files(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)