changeset 87:08d8ffd40f27

add some tests for the PackageTrack.last_packaged_revision() method
author Bernhard Herzog <bh@intevation.de>
date Tue, 11 Sep 2007 10:05:15 +0000
parents 9bd92a3290e0
children 3ae54f99db26
files test/test_packager.py
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_packager.py	Tue Sep 11 10:03:58 2007 +0000
+++ b/test/test_packager.py	Tue Sep 11 10:05:15 2007 +0000
@@ -153,3 +153,22 @@
                                ("binary", [])])])])
         track = PackageTrack("testtrack", self.trackdir, "", "", "", "", "")
         self.assertEquals(track.get_revision_numbers(), [702432, 704195])
+
+    def test_last_packaged_revision_with_no_revisions(self):
+        self.create_files(self.trackdir, [("pkg", [])])
+        track = PackageTrack("testtrack", self.trackdir, "", "", "", "", "")
+        self.assertEquals(track.last_packaged_revision(), -1)
+
+    def test_last_packaged_revision_several_revisions(self):
+        self.create_files(self.trackdir,
+                          [("pkg",
+                            [("704195-1",
+                              [("status", ""),
+                               ("src", []),
+                               ("binary", [])]),
+                             ("702432-1",
+                              [("status", ""),
+                               ("src", []),
+                               ("binary", [])])])])
+        track = PackageTrack("testtrack", self.trackdir, "", "", "", "", "")
+        self.assertEquals(track.last_packaged_revision(), 704195)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)