Mercurial > treepkg
comparison test/test_packager.py @ 86:9bd92a3290e0
In TestPackageTrack, create the test files in the test_-methods so that
they can be defined on a test by test basis
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 11 Sep 2007 10:03:58 +0000 |
parents | 31b0567df051 |
children | 08d8ffd40f27 |
comparison
equal
deleted
inserted
replaced
85:31b0567df051 | 86:9bd92a3290e0 |
---|---|
132 "testpkg_2-kk1_i386.changes"]) | 132 "testpkg_2-kk1_i386.changes"]) |
133 | 133 |
134 | 134 |
135 class TestPackageTrack(unittest.TestCase, FileTestMixin): | 135 class TestPackageTrack(unittest.TestCase, FileTestMixin): |
136 | 136 |
137 track_files = [("pkg", | |
138 [("704195-1", | |
139 [("status", ""), | |
140 ("src", []), | |
141 ("binary", [])]), | |
142 # Note: The revisions are not ordered so that we | |
143 # can check whether get_revision_numbers returns a | |
144 # sorted list of revisions | |
145 ("702432-1", | |
146 [("status", ""), | |
147 ("src", []), | |
148 ("binary", [])])])] | |
149 | |
150 def setUp(self): | 137 def setUp(self): |
151 self.trackdir = self.create_temp_dir(self.id() + "-track") | 138 self.trackdir = self.create_temp_dir(self.id() + "-track") |
152 self.create_files(self.trackdir, self.track_files) | |
153 | 139 |
154 def test_get_revision_numbers(self): | 140 def test_get_revision_numbers(self): |
141 # Note: The revisions in the pkg dir are not ordered so that we | |
142 # can check whether get_revision_numbers returns a sorted list | |
143 # of revisions | |
144 self.create_files(self.trackdir, | |
145 [("pkg", | |
146 [("704195-1", | |
147 [("status", ""), | |
148 ("src", []), | |
149 ("binary", [])]), | |
150 ("702432-1", | |
151 [("status", ""), | |
152 ("src", []), | |
153 ("binary", [])])])]) | |
155 track = PackageTrack("testtrack", self.trackdir, "", "", "", "", "") | 154 track = PackageTrack("testtrack", self.trackdir, "", "", "", "", "") |
156 self.assertEquals(track.get_revision_numbers(), [702432, 704195]) | 155 self.assertEquals(track.get_revision_numbers(), [702432, 704195]) |