aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-12-17 19:04:34 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-12-17 19:04:34 -0200
commit4834f0c4bab9f1b44a3540a4dd15a52799f764fd (patch)
tree2833c8d56709be9427eb24ccb98d70c473d361b4 /tests/test_description_tree.py
parentadded P/PN/PV to the svn description files, and added CAT (diff)
downloadg-octave-4834f0c4bab9f1b44a3540a4dd15a52799f764fd.tar.gz
g-octave-4834f0c4bab9f1b44a3540a4dd15a52799f764fd.tar.bz2
g-octave-4834f0c4bab9f1b44a3540a4dd15a52799f764fd.zip
rewrote DescriptionTree, as a list of Description objects
Diffstat (limited to 'tests/test_description_tree.py')
-rw-r--r--tests/test_description_tree.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/tests/test_description_tree.py b/tests/test_description_tree.py
index 8e28553..ad00643 100644
--- a/tests/test_description_tree.py
+++ b/tests/test_description_tree.py
@@ -54,42 +54,42 @@ class TestDescriptionTree(testcase.TestCase):
self._tree.latest_version(pkg)
)
- def test_version_compare(self):
+ def test_latest_version_from_list(self):
# TODO: cover a better range of versions
versions = [
- # ((version1, version2), latest_version)
- (('1', '2'), '2'),
- (('0.1', '1'), '1'),
- (('0.1', '0.2'), '0.2'),
- (('0.0.1', '1'), '1'),
- (('0.0.1', '0.1'), '0.1'),
- (('0.0.1', '0.0.2'), '0.0.2'),
- (('2', '1'), '2'),
- (('1', '0.1'), '1'),
- (('0.2', '0.1'), '0.2'),
- (('1', '0.0.1'), '1'),
- (('0.1', '0.0.1'), '0.1'),
- (('0.0.2', '0.0.1'), '0.0.2'),
+ # ([version1, version2], latest_version)
+ (['1', '2'], '2'),
+ (['0.1', '1'], '1'),
+ (['0.1', '0.2'], '0.2'),
+ (['0.0.1', '1'], '1'),
+ (['0.0.1', '0.1'], '0.1'),
+ (['0.0.1', '0.0.2'], '0.0.2'),
+ (['2', '1'], '2'),
+ (['1', '0.1'], '1'),
+ (['0.2', '0.1'], '0.2'),
+ (['1', '0.0.1'], '1'),
+ (['0.1', '0.0.1'], '0.1'),
+ (['0.0.2', '0.0.1'], '0.0.2'),
]
for ver, latest in versions:
- self.assertEqual(self._tree.version_compare(ver), latest)
+ self.assertEqual(self._tree.latest_version_from_list(ver), latest)
def test_description_files(self):
packages = [
- ('main', 'main1', '0.0.1'),
- ('main', 'main2', '0.0.1'),
- ('main', 'main2', '0.0.2'),
- ('extra', 'extra1', '0.0.1'),
- ('extra', 'extra2', '0.0.1'),
- ('extra', 'extra2', '0.0.2'),
- ('language', 'language1', '0.0.1'),
- ('language', 'language2', '0.0.1'),
- ('language', 'language2', '0.0.2'),
+ 'main1-0.0.1',
+ 'main2-0.0.1',
+ 'main2-0.0.2',
+ 'extra1-0.0.1',
+ 'extra2-0.0.1',
+ 'extra2-0.0.2',
+ 'language1-0.0.1',
+ 'language2-0.0.1',
+ 'language2-0.0.2',
]
- for cat, pkg, ver in packages:
+ for pkg in packages:
self.assertTrue(
isinstance(
- self._tree[pkg+'-'+ver],
+ self._tree.get(pkg),
description.Description
)
)
@@ -99,6 +99,6 @@ def suite():
suite = unittest.TestSuite()
suite.addTest(TestDescriptionTree('test_package_versions'))
suite.addTest(TestDescriptionTree('test_latest_version'))
- suite.addTest(TestDescriptionTree('test_version_compare'))
+ suite.addTest(TestDescriptionTree('test_latest_version_from_list'))
suite.addTest(TestDescriptionTree('test_description_files'))
return suite